X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmsgbase.h;h=4b53032eb75157e727d2b9bfcdcef85c9246f23b;hb=dbaf416c5e665af584ad1db3109cc5486fdfa96f;hp=59ee421e01e2dec32c076f8b2e56838ce6647bde;hpb=314acc50c58e49fb9a5df9d7f0c24b2535ba0757;p=citadel.git diff --git a/citadel/msgbase.h b/citadel/msgbase.h index 59ee421e0..4b53032eb 100644 --- a/citadel/msgbase.h +++ b/citadel/msgbase.h @@ -77,7 +77,7 @@ void memfmout (char *mptr, const char *nl); void output_mime_parts(char *); long send_message (struct CtdlMessage *); void loadtroom (void); -long CtdlSubmitMsg(struct CtdlMessage *, struct recptypes *, const char *, int); +long CtdlSubmitMsg(struct CtdlMessage *, recptypes *, const char *, int); void quickie_message(const char *from, const char *fromaddr, @@ -96,7 +96,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 +116,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 +126,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); @@ -135,6 +135,7 @@ void CM_SetFieldLONG (struct CtdlMessage *Msg, eMsgField which, long lvalue); void CM_CopyField (struct CtdlMessage *Msg, eMsgField WhichToPutTo, eMsgField WhichtToCopy); void CM_CutFieldAt (struct CtdlMessage *Msg, eMsgField WhichToCut, long maxlen); void CM_FlushField (struct CtdlMessage *Msg, eMsgField which); +void CM_Flush (struct CtdlMessage *Msg); void CM_SetAsField (struct CtdlMessage *Msg, eMsgField which, char **buf, long length); void CM_SetAsFieldSB (struct CtdlMessage *Msg, eMsgField which, StrBuf **buf); void CM_GetAsField (struct CtdlMessage *Msg, eMsgField which, char **ret, long *retlen); @@ -144,11 +145,17 @@ void CM_Free (struct CtdlMessage *msg); void CM_FreeContents (struct CtdlMessage *msg); int CM_IsValidMsg (struct CtdlMessage *msg); +#define CM_KEY(Message, Which) Message->cm_fields[Which], Message->cm_lengths[Which] +#define CM_RANGE(Message, Which) Message->cm_fields[Which], \ + 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, @@ -160,14 +167,15 @@ StrBuf *CtdlReadMessageBodyBuf(char *terminator, /* token signalling EOT */ ); int CtdlOutputMsg(long msg_num, /* message number (local) to fetch */ - int mode, /* how would you like that message? */ - int headers_only, /* eschew the message body? */ - int do_proto, /* do Citadel protocol responses? */ - int crlf, /* 0=LF, 1=CRLF */ - char *section, /* output a message/rfc822 section */ - int flags, /* should the bessage be exported clean? */ - char **Author, /* if you want to know the author of the message... */ - char **Address /* if you want to know the sender address of the message... */ + int mode, /* how would you like that message? */ + int headers_only, /* eschew the message body? */ + int do_proto, /* do Citadel protocol responses? */ + int crlf, /* 0=LF, 1=CRLF */ + char *section, /* output a message/rfc822 section */ + int flags, /* should the bessage be exported clean? */ + char **Author, /* if you want to know the author of the message... */ + char **Address, /* if you want to know the sender address of the message... */ + char **MessageID /* if you want to know the Message-ID of the message... */ ); /* Flags which may be passed to CtdlOutputMsg() and CtdlOutputPreLoadedMsg() */ @@ -210,7 +218,29 @@ struct CtdlMessage *CtdlMakeMessage( char *preformatted_text, /* ...or NULL to read text from client */ char *references /* Thread references */ ); -int CtdlIsMe(char *addr, int addr_buf_len); + +struct CtdlMessage *CtdlMakeMessageLen( + struct ctdluser *author, /* author's user structure */ + char *recipient, /* NULL if it's not mail */ + long rcplen, + char *recp_cc, /* NULL if it's not mail */ + long cclen, + char *room, /* room where it's going */ + long roomlen, + int type, /* see MES_ types in header file */ + int format_type, /* variformat, plain text, MIME... */ + char *fake_name, /* who we're masquerading as */ + long fnlen, + char *my_email, /* which of my email addresses to use (empty is ok) */ + long myelen, + char *subject, /* Subject (optional) */ + long subjlen, + char *supplied_euid, /* ...or NULL if this is irrelevant */ + long euidlen, + char *preformatted_text, /* ...or NULL to read text from client */ + long textlen, + char *references, /* Thread references */ + long reflen); /* * loading messages async via an FD: @@ -237,12 +267,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)