projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f757bc7
)
Construct the msgid for wiki entries by appending the page
author
Wilfried Goesgens
<willi@arangodb.com>
Sun, 3 Jan 2016 16:04:35 +0000
(17:04 +0100)
committer
Wilfried Goesgens
<willi@arangodb.com>
Sun, 3 Jan 2016 16:04:35 +0000
(17:04 +0100)
citadel/modules/wiki/serv_wiki.c
patch
|
blob
|
history
diff --git
a/citadel/modules/wiki/serv_wiki.c
b/citadel/modules/wiki/serv_wiki.c
index 7320a156e94a9e4acdf4e12ee15620561171a826..cc1f9ed2a0eaadcdf255b48b512b8a87587ed4a3 100644
(file)
--- 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;
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. */
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);
/* 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]);
history_page_len = snprintf(history_page, sizeof history_page,
"%s_HISTORY_", msg->cm_fields[eExclusiveID]);