From 34a0c6284f53e77a7803018840393ae2c6a76235 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Mon, 22 Mar 2010 04:57:27 +0000 Subject: [PATCH] * more work on the dead buddies purge --- citadel/modules/xmpp/xmpp_presence.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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); } -- 2.30.2