X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmsgbase.h;h=6ba7603ef5d1de5b257f64428fdc68f52a4ebde5;hb=e047988e5cb07d89edeec13afea5c25a52ef26c6;hp=34b5ec599a0f9463dbf44ebe2cfe7e467609432e;hpb=e86cae42a7b279758e7d5de8785793af5cdf689d;p=citadel.git diff --git a/citadel/msgbase.h b/citadel/msgbase.h index 34b5ec599..6ba7603ef 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 }; /* @@ -74,36 +75,12 @@ 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, - const 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); @@ -156,18 +133,18 @@ 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, - 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 */ - ); +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? */ @@ -201,9 +178,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); @@ -243,41 +223,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 */