X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Fmodules%2Fwiki%2Fserv_wiki.c;h=77f7899f157c6d3e5acca6081a78bb80117accd0;hp=4643d917d3a2669da8f5e890474cc77565fbc987;hb=6f073ed0a823aa4a8e56a0b3b1c5a17cfc976e33;hpb=a56b999c2b4256085b25cca5906399a3a49aa9e1 diff --git a/citadel/modules/wiki/serv_wiki.c b/citadel/modules/wiki/serv_wiki.c index 4643d917d..77f7899f1 100644 --- a/citadel/modules/wiki/serv_wiki.c +++ b/citadel/modules/wiki/serv_wiki.c @@ -603,6 +603,18 @@ void wiki_rev(char *pagename, char *rev, char *operation) msg->cm_fields['A'] = strdup("Citadel"); CtdlCreateRoom(wwm, 5, "", 0, 1, 1, VIEW_BBS); /* Not an error if already exists */ msgnum = CtdlSubmitMsg(msg, NULL, wwm, 0); /* Store the revision here */ + + /* + * WARNING: VILE SLEAZY HACK + * This will avoid the 'message xxx is not in this room' security error, + * but only if the client fetches the message we just generated immediately + * without first trying to perform other fetch operations. + */ + if (CC->cached_msglist != NULL) free(CC->cached_msglist); + CC->cached_num_msgs = 1; + CC->cached_msglist = malloc(sizeof(long)); + CC->cached_msglist[0] = msgnum; + } else if (!strcasecmp(operation, "revert")) { snprintf(timestamp, sizeof timestamp, "%ld", time(NULL));