From: Wilfried Goesgens Date: Sun, 3 Jan 2016 16:04:35 +0000 (+0100) Subject: Construct the msgid for wiki entries by appending the page X-Git-Tag: Release_902~81 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=8cd3062b557af3493a84649f7c119024af465032;hp=f757bc7bb08a3673f553ca29372d5498a7bbf0c6 Construct the msgid for wiki entries by appending the page --- diff --git a/citadel/modules/wiki/serv_wiki.c b/citadel/modules/wiki/serv_wiki.c index 7320a156e..cc1f9ed2a 100644 --- a/citadel/modules/wiki/serv_wiki.c +++ b/citadel/modules/wiki/serv_wiki.c @@ -90,6 +90,8 @@ int wiki_upload_beforesave(struct CtdlMessage *msg, recptypes *recp) { char *diffbuf = NULL; size_t diffbuf_len = 0; char *ptr = NULL; + long newmsgid; + StrBuf *msgidbuf; if (!CCC->logged_in) return(0); /* Only do this if logged in. */ @@ -105,6 +107,17 @@ int wiki_upload_beforesave(struct CtdlMessage *msg, recptypes *recp) { /* If there's no EUID we can't do this. Reject the post. */ if (CM_IsEmpty(msg, eExclusiveID)) return(1); + newmsgid = get_new_message_number(); + msgidbuf = NewStrBuf(); + StrBufPrintf(msgidbuf, "%08lX-%08lX@%s/%s", + (long unsigned int) time(NULL), + (long unsigned int) newmsgid, + CtdlGetConfigStr("c_fqdn"), + msg->cm_fields[eExclusiveID] + ); + + CM_SetAsFieldSB(msg, emessageId, &msgidbuf); + history_page_len = snprintf(history_page, sizeof history_page, "%s_HISTORY_", msg->cm_fields[eExclusiveID]);