X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Fmsgbase.h;h=308c3aa335b8b4949b86b66343afcdecfa613d7c;hp=aecdb18f6c9525dce5ea8578f464b39ff152006b;hb=5ac2920028e92a453c686c799327d7a66b3e7b49;hpb=4e9952daf6d736348f34fa1e02f33a568d25d894 diff --git a/citadel/msgbase.h b/citadel/msgbase.h index aecdb18f6..308c3aa33 100644 --- a/citadel/msgbase.h +++ b/citadel/msgbase.h @@ -2,7 +2,6 @@ #ifndef MSGBASE_H #define MSGBASE_H -#include "event_client.h" enum { MSGS_ALL, MSGS_OLD, @@ -18,7 +17,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 }; /* @@ -59,7 +60,6 @@ struct repl { /* Info for replication checking */ }; - /* * This is a list of "harvested" email addresses that we might want to * stick into someone's address book. But we defer this operaiton so @@ -73,34 +73,13 @@ 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); - -void flood_protect_quickie_message(const char *from, - const char *fromaddr, - const char *to, - char *room, - const char *text, - int format_type, - const char *subject, - int nCriterions, - const char **CritStr, - long *CritStrLen, - long ccid, - long ioid, - time_t NOW); - +long quickie_message(const char *from, const char *fromaddr, const char *to, char *room, const char *text, int format_type, const char *subject); void GetMetaData(struct MetaData *, long); void PutMetaData(struct MetaData *); void AdjRefCount(long, int); @@ -116,7 +95,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 +105,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,29 +129,32 @@ 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); -char *CtdlReadMessageBody(char *terminator, long tlen, size_t maxlen, StrBuf *exist, int crlf, int *sock); -StrBuf *CtdlReadMessageBodyBuf(char *terminator, /* token signalling EOT */ - long tlen, - size_t maxlen, /* maximum message length */ - StrBuf *exist, /* if non-null, append to it; - exist is ALWAYS freed */ - int crlf, /* CRLF newlines instead of LF */ - int *sock /* socket handle or 0 for this session's client socket */ - ); +long CtdlSaveThisMessage(struct CtdlMessage *msg, long msgid, int Reply); +char *CtdlReadMessageBody(char *terminator, long tlen, size_t maxlen, StrBuf *exist, int crlf); +StrBuf *CtdlReadMessageBodyBuf( + char *terminator, /* token signalling EOT */ + long tlen, + size_t maxlen, /* maximum message length */ + StrBuf *exist, /* if non-null, append to it; exist is ALWAYS freed */ + int crlf /* CRLF newlines instead of LF */ +); 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() */ @@ -195,9 +177,12 @@ enum { ctdlsetseen_seen, ctdlsetseen_answered }; + void CtdlSetSeen(long *target_msgnums, int num_target_msgnums, - int target_setting, int which_set, - struct ctdluser *which_user, struct ctdlroom *which_room); + int target_setting, int which_set, + struct ctdluser *which_user, struct ctdlroom *which_room +); + void CtdlGetSeen(char *buf, int which_set); @@ -237,41 +222,9 @@ struct CtdlMessage *CtdlMakeMessageLen( char *preformatted_text, /* ...or NULL to read text from client */ long textlen, char *references, /* Thread references */ - long reflen); - -/* - * loading messages async via an FD: - * add IO->ReadMsg = NewAsyncMsg(...) - * and then call CtdlReadMessageBodyAsync() from your linreader handler. - */ - -ReadAsyncMsg *NewAsyncMsg(const char *terminator, /* token signalling EOT */ - long tlen, - size_t expectlen, /* if we expect a message, how long should it be? */ - size_t maxlen, /* maximum message length */ - StrBuf *exist, /* if non-null, append to it; - exist is ALWAYS freed */ - long eLen, /* length of exist */ - int crlf /* CRLF newlines instead of LF */ - ); - -eReadState CtdlReadMessageBodyAsync(AsyncIO *IO); -void DeleteAsyncMsg(ReadAsyncMsg **Msg); - -extern int MessageDebugEnabled; - -#define MSGDBGLOG(LEVEL) if ((LEVEL != LOG_DEBUG) || (MessageDebugEnabled != 0)) -#define CCCID CCC->cs_pid -#define MSG_syslog(LEVEL, FORMAT, ...) \ - MSGDBGLOG(LEVEL) syslog(LEVEL, \ - "CC[%d]MSG" FORMAT, \ - CCCID, __VA_ARGS__) - -#define MSGM_syslog(LEVEL, FORMAT) \ - MSGDBGLOG(LEVEL) syslog(LEVEL, \ - "CC[%d]MSG" FORMAT, \ - CCCID) - + long reflen +); +void AdjRefCountList(long *msgnum, long nmsg, int incr); #endif /* MSGBASE_H */