X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fxmpp%2Fxmpp_presence.c;h=3df2217c3b78e996da2240ff27ebd87dae88b24c;hb=34a0c6284f53e77a7803018840393ae2c6a76235;hp=1a4cda0482c3f5e0fd8f534b25bd73063b144083;hpb=4a967914a4f4701053ba3a3fb96395b676f83de2;p=citadel.git diff --git a/citadel/modules/xmpp/xmpp_presence.c b/citadel/modules/xmpp/xmpp_presence.c index 1a4cda048..3df2217c3 100644 --- a/citadel/modules/xmpp/xmpp_presence.c +++ b/citadel/modules/xmpp/xmpp_presence.c @@ -211,6 +211,8 @@ HashList *xmpp_fetch_mortuary(void) { return(NULL); } + /* FIXME finish this */ + return(mortuary); } @@ -225,14 +227,29 @@ void xmpp_store_mortuary(HashList *mortuary) { long len; void *Value; const char *Key; + StrBuf *themsg; + + themsg = NewStrBuf(); + StrBufPrintf(themsg, "Content-type: " XMPPMORTUARY "\n" + "Content-transfer-encoding: 7bit\n" + "\n" + ); HashPos = GetNewHashPos(mortuary, 0); while (GetNextHashPos(mortuary, HashPos, &len, &Key, &Value) != 0) { - CtdlLogPrintf(CTDL_DEBUG, "FIXME WRITE \033[31m%s\033[0m\n", (char *)Value); + StrBufAppendPrintf(themsg, "%s\n", (char *)Value); /* note: don't free(Value) -- deleting the hash list will handle this for us */ } DeleteHashPos(&HashPos); + + /* Save it to disk */ + quickie_message("Citadel", NULL, NULL, USERCONFIGROOM, ChrPtr(themsg), 4, "XMPP Mortuary"); + + /* Delete the old one */ + CtdlDeleteMessages(USERCONFIGROOM, NULL, 0, XMPPMORTUARY); + + FreeStrBuf(&themsg); }