* When saving a wiki page, set the message subject to the page name. This will make...
authorArt Cancro <ajc@citadel.org>
Sun, 8 Nov 2009 04:50:42 +0000 (04:50 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 8 Nov 2009 04:50:42 +0000 (04:50 +0000)
citadel/modules/wiki/serv_wiki.c

index c99f7e1b8b504b1fa489ebf579879a829dff86d9..d3d071b4132a255485024289d4625892b0281ee3 100644 (file)
@@ -125,6 +125,12 @@ int wiki_upload_beforesave(struct CtdlMessage *msg) {
        /* If there's no message text, obviously this is all b0rken and shouldn't happen at all */
        if (msg->cm_fields['M'] == NULL) return(0);
 
+       /* Set the message subject identical to the page name */
+       if (msg->cm_fields['U'] != NULL) {
+               free(msg->cm_fields['U']);
+       }
+       msg->cm_fields['U'] = strdup(msg->cm_fields['E']);
+
        /* See if we can retrieve the previous version. */
        old_msgnum = locate_message_by_euid(msg->cm_fields['E'], &CCC->room);
        if (old_msgnum > 0L) {