Introduce new MSGS mode for threads to avoid breaking old webcit subject lines
[citadel.git] / citadel / msgbase.h
index e4e2317b61b4a982d331b0c1616436b6178a0221..90be427f87613dd7a2afb90ed28d22fabc194eaa 100644 (file)
@@ -18,7 +18,9 @@ enum {
 enum {
        MSG_HDRS_BRIEF = 0,
        MSG_HDRS_ALL = 1,
-       MSG_HDRS_EUID = 4
+       MSG_HDRS_EUID = 4,
+       MSG_HDRS_BRIEFFILTER = 8,
+       MSG_HDRS_THREADS = 9
 };
 
 /*
@@ -73,19 +75,16 @@ struct addresses_to_be_filed {
 
 extern struct addresses_to_be_filed *atbf;
 
+int GetFieldFromMnemonic(eMsgField *f, const char* c);
+
+
 void memfmout (char *mptr, const char *nl);
 void output_mime_parts(char *);
 long send_message (struct CtdlMessage *);
 void loadtroom (void);
 long CtdlSubmitMsg(struct CtdlMessage *, recptypes *, const char *, int);
 
-void quickie_message(const char *from,
-                    const char *fromaddr,
-                    const char *to,
-                    char *room,
-                    const char *text, 
-                    int format_type,
-                    const char *subject);
+long quickie_message(const char *from, const char *fromaddr, const char *to, char *room, const char *text, int format_type, const char *subject);
 
 void flood_protect_quickie_message(const char *from,
                                   const char *fromaddr,
@@ -96,7 +95,7 @@ void flood_protect_quickie_message(const char *from,
                                   const char *subject,
                                   int nCriterions,
                                   const char **CritStr,
-                                  long *CritStrLen,
+                                  const long *CritStrLen,
                                   long ccid,
                                   long ioid,
                                   time_t NOW);
@@ -116,7 +115,7 @@ int CtdlForEachMessage(int mode,
                        struct CtdlMessage *compare,
                         ForEachMsgCallback CallBack,
                        void *userdata);
-int CtdlDeleteMessages(char *, long *, int, char *);
+int CtdlDeleteMessages(const char *, long *, int, char *);
 void CtdlWriteObject(char *req_room,                   /* Room to stuff it in */
                        char *content_type,             /* MIME type of this object */
                        char *raw_message,              /* Data to be written */
@@ -126,7 +125,7 @@ void CtdlWriteObject(char *req_room,                        /* Room to stuff it in */
                        int is_unique,                  /* Del others of this type? */
                        unsigned int flags              /* Internal save flags */
 );
-struct CtdlMessage *CtdlFetchMessage(long msgnum, int with_body);
+struct CtdlMessage *CtdlFetchMessage(long msgnum, int with_body, int run_msg_hooks);
 struct CtdlMessage * CM_Duplicate
                        (struct CtdlMessage *OrgMsg);
 int  CM_IsEmpty        (struct CtdlMessage *Msg, eMsgField which);
@@ -150,10 +149,12 @@ int  CM_IsValidMsg     (struct CtdlMessage *msg);
                Message->cm_fields[Which] + Message->cm_lengths[Which]
 
 void CtdlSerializeMessage(struct ser_ret *, struct CtdlMessage *);
+struct CtdlMessage *CtdlDeserializeMessage(long msgnum, int with_body, const char *Buffer, long Length);
 void ReplicationChecks(struct CtdlMessage *);
 int CtdlSaveMsgPointersInRoom(char *roomname, long newmsgidlist[], int num_newmsgs,
-                       int do_repl_check, struct CtdlMessage *supplied_msg, int suppress_refcount_adj);
+                             int do_repl_check, struct CtdlMessage *supplied_msg, int suppress_refcount_adj);
 int CtdlSaveMsgPointerInRoom(char *roomname, long msgid, int do_repl_check, struct CtdlMessage *msg);
+long CtdlSaveThisMessage(struct CtdlMessage *msg, long msgid, int Reply);
 char *CtdlReadMessageBody(char *terminator, long tlen, size_t maxlen, StrBuf *exist, int crlf, int *sock);
 StrBuf *CtdlReadMessageBodyBuf(char *terminator,       /* token signalling EOT */
                               long tlen,
@@ -265,12 +266,12 @@ extern int MessageDebugEnabled;
 #define CCCID CCC->cs_pid
 #define MSG_syslog(LEVEL, FORMAT, ...)                 \
        MSGDBGLOG(LEVEL) syslog(LEVEL,                  \
-                               "CC[%d]MSG" FORMAT,     \
+                               "CC[%d]MSG " FORMAT,    \
                                CCCID, __VA_ARGS__)
 
 #define MSGM_syslog(LEVEL, FORMAT)                     \
        MSGDBGLOG(LEVEL) syslog(LEVEL,                  \
-                               "CC[%d]MSG" FORMAT,     \
+                               "CC[%d]MSG " FORMAT,    \
                                CCCID)