* Added a new message field '1' which may be set by BeforeSave hooks. The presence...
authorArt Cancro <ajc@citadel.org>
Tue, 10 Nov 2009 03:58:32 +0000 (03:58 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 10 Nov 2009 03:58:32 +0000 (03:58 +0000)
* Set this field on wiki history pages.

citadel/modules/fulltext/serv_fulltext.c
citadel/modules/wiki/serv_wiki.c
citadel/techdoc/hack.txt

index d6d9d64396d9dfa384c148bdf7a40e2d364fc842..c76671d8ef6e0fe55ec9ae70bf560b84de29a07c 100644 (file)
@@ -125,6 +125,19 @@ void ft_index_message(long msgnum, int op) {
        struct cdbdata *cdb_bucket;
        char *msgtext;
        int tok;
+       struct CtdlMessage *msg = NULL;
+
+       msg = CtdlFetchMessage(msgnum, 1);
+       if (msg == NULL) {
+               CtdlLogPrintf(CTDL_ERR, "ft_index_message() could not load msg %ld\n", msgnum);
+               return;
+       }
+
+       if (msg->cm_fields['1'] != NULL) {
+               CtdlLogPrintf(CTDL_DEBUG, "ft_index_message() excluded msg %ld\n", msgnum);
+               CtdlFreeMessage(msg);
+               return;
+       }
 
        CtdlLogPrintf(CTDL_DEBUG, "ft_index_message() %s msg %ld\n",
                (op ? "adding" : "removing") , msgnum
@@ -136,7 +149,8 @@ void ft_index_message(long msgnum, int op) {
        CC->redirect_buffer = malloc(SIZ);
        CC->redirect_len = 0;
        CC->redirect_alloc = SIZ;
-       CtdlOutputMsg(msgnum, MT_CITADEL, HEADERS_ALL, 0, 1, NULL, 0);
+       CtdlOutputPreLoadedMsg(msg, MT_CITADEL, HEADERS_ALL, 0, 1, 0);
+       CtdlFreeMessage(msg);
        msgtext = CC->redirect_buffer;
        CC->redirect_buffer = NULL;
        CC->redirect_len = 0;
index d3d071b4132a255485024289d4625892b0281ee3..b9e3ad45456f538cecaaac7add6495662a3cbff3 100644 (file)
@@ -218,6 +218,7 @@ int wiki_upload_beforesave(struct CtdlMessage *msg) {
                history_msg->cm_fields['R'] = strdup(CCC->room.QRname);
                history_msg->cm_fields['E'] = strdup(history_page);
                history_msg->cm_fields['U'] = strdup(history_page);
+               history_msg->cm_fields['1'] = strdup("1");              /* suppress full text indexing */
                snprintf(boundary, sizeof boundary, "Citadel--Multipart--%04x--%08lx", getpid(), time(NULL));
                history_msg->cm_fields['M'] = malloc(1024);
                snprintf(history_msg->cm_fields['M'], 1024,
index 52bbcb0e53d2b6873155570189940c64d093b1f5..bf6715c5e325e747519d4f617a521e75df35f9f5 100644 (file)
@@ -36,8 +36,6 @@ struct ctdluser {                       /* User record                      */
         time_t lastcall;                /* Last time the user called        */
         int USuserpurge;                /* Purge time (in days) for user    */
         char fullname[64];              /* Name for Citadel messages & mail */
-        CIT_UBYTE USscreenwidth;        /* Screen width (for textmode users)*/
-        CIT_UBYTE USscreenheight;       /* Screen height(for textmode users)*/
 };
  
  Most fields here should be fairly self-explanatory.  The ones that might
@@ -53,11 +51,6 @@ important because it allows us to use this number in other data structures
 without having to worry about users being added/removed later on, as you'll
 see later in this document.
  
- The screenwidth and screenheight fields are almost never used anymore.  Back
-when people were calling into dialup systems we had no way of knowing the
-user's screen dimensions, but modern networks almost always transmit this
-information so we set it up dynamically.
  
  ROOM RECORDS
  ------------
@@ -276,7 +269,7 @@ S       Special field   Only meaningful for messages being spooled over a
                         a message, but rather some other network function:
                         -> "S" followed by "FILE" (followed by a null, of
                            course) means that the message text is actually an
-                           IGnet/Open file transfer.
+                           IGnet/Open file transfer.  (OBSOLETE)
                        -> "S" followed by "CANCEL" means that this message
                           should be deleted from the local message base once
                           it has been replicated to all network systems.
@@ -295,6 +288,8 @@ Y   carbon copY     Optional, and only in Mail messages.
                        expected to fill in this field when rejecting a message
                        with an explanation as to what happened (virus found,
                        message looks like spam, etc.)
+1      suppress index  The presence of this field indicates that the message is
+                       disqualified from being added to the full text index.
   
                        EXAMPLE