citadel
About: Citadel is an advanced messaging and collaboration system for groupware and BBS applications (preferred OS: Linux).
![]() ![]() |
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <signal.h>
#include <pwd.h>
#include <errno.h>
#include <sys/types.h>
#include <time.h>
#include <sys/wait.h>
#include <string.h>
#include <limits.h>
#include <libcitadel.h>
#include "../../sysdep.h"
#include "../../citadel_defs.h"
#include "../../server.h"
#include "../../context.h"
#include "../../citserver.h"
#include "../../support.h"
#include "../../config.h"
#include "../../msgbase.h"
#include "../../user_ops.h"
#include "../../ctdl_module.h"
#include "serv_instmsg.h"
Go to the source code of this file.
Data Structures | |
struct | imlog |
Functions | |
void | log_instant_message (struct CitContext *me, struct CitContext *them, char *msgtext, int serial_number) |
void | delete_instant_messages (void) |
void | cmd_gexp (char *argbuf) |
void | cmd_gexp_async (void) |
void | add_xmsg_to_context (struct CitContext *ccptr, struct ExpressMessage *newmsg) |
int | send_instant_message (char *lun, char *lem, char *x_user, char *x_msg) |
void | cmd_sexp (char *argbuf) |
void | cmd_dexp (char *argbuf) |
void | cmd_reqt (char *argbuf) |
void | flush_individual_conversation (struct imlog *im) |
void | flush_conversations_to_disk (time_t if_older_than) |
void | instmsg_timer (void) |
void | instmsg_shutdown (void) |
char * | ctdl_module_init_instmsg (void) |
Variables | |
struct imlog * | imlist = NULL |
void add_xmsg_to_context | ( | struct CitContext * | ccptr, |
struct ExpressMessage * | newmsg | ||
) |
Definition at line 174 of file serv_instmsg.c.
References CitContext::FirstExpressMessage, ExpressMessage::next, and set_async_waiting().
Referenced by cmd_reqt(), and send_instant_message().
void cmd_dexp | ( | char * | argbuf | ) |
Definition at line 325 of file serv_instmsg.c.
References ac_logged_in, CC, CIT_OK, cprintf(), and CtdlAccessCheck().
Referenced by ctdl_module_init_instmsg().
void cmd_gexp | ( | char * | argbuf | ) |
Definition at line 127 of file serv_instmsg.c.
References begin_critical_section(), CC, cprintf(), CtdlGetConfigStr(), end_critical_section(), ERROR, ExpressMessage::flags, free(), LISTING_FOLLOWS, memfmout(), MESSAGE_NOT_FOUND, ExpressMessage::next, S_SESSION_TABLE, ExpressMessage::sender, ExpressMessage::sender_email, ExpressMessage::text, and ExpressMessage::timestamp.
Referenced by ctdl_module_init_instmsg().
void cmd_gexp_async | ( | void | ) |
Definition at line 161 of file serv_instmsg.c.
References ASYNC_GEXP, ASYNC_MSG, CC, and cprintf().
Referenced by ctdl_module_init_instmsg().
void cmd_reqt | ( | char * | argbuf | ) |
Definition at line 340 of file serv_instmsg.c.
References ac_aide, add_xmsg_to_context(), begin_critical_section(), CC, CIT_OK, ContextList, cprintf(), CitContext::cs_pid, CtdlAccessCheck(), EM_GO_AWAY, end_critical_section(), ExpressMessage::flags, malloc(), CitContext::next, S_SESSION_TABLE, ExpressMessage::sender, ExpressMessage::text, and ExpressMessage::timestamp.
Referenced by ctdl_module_init_instmsg().
void cmd_sexp | ( | char * | argbuf | ) |
Definition at line 245 of file serv_instmsg.c.
References CC, CIT_OK, client_getln(), cprintf(), CtdlGetUser(), ERROR, free(), HIGHER_ACCESS_REQUIRED, malloc(), NO_SUCH_USER, NOT_LOGGED_IN, PerformXmsgHooks(), RESOURCE_NOT_OPEN, SEND_LISTING, SIZ, unbuffer_output(), and USERNAME_SIZE.
Referenced by ctdl_module_init_instmsg().
char * ctdl_module_init_instmsg | ( | void | ) |
Definition at line 525 of file serv_instmsg.c.
References cmd_dexp(), cmd_gexp(), cmd_gexp_async(), cmd_reqt(), cmd_sexp(), CtdlRegisterProtoHook(), CtdlRegisterSessionHook(), CtdlRegisterXmsgHook(), delete_instant_messages(), EVT_ASYNC, EVT_SHUTDOWN, EVT_STOP, EVT_TIMER, instmsg_shutdown(), instmsg_timer(), PRIO_ASYNC, PRIO_CLEANUP, PRIO_SHUTDOWN, PRIO_STOP, send_instant_message(), threading, and XMSG_PRI_LOCAL.
Referenced by initialize_modules().
void delete_instant_messages | ( | void | ) |
Definition at line 111 of file serv_instmsg.c.
References begin_critical_section(), CC, end_critical_section(), free(), ExpressMessage::next, and S_SESSION_TABLE.
Referenced by ctdl_module_init_instmsg().
void flush_conversations_to_disk | ( | time_t | if_older_than | ) |
Definition at line 451 of file serv_instmsg.c.
References begin_critical_section(), CtdlGetContextArray(), end_critical_section(), flush_individual_conversation(), free(), imlist, imlog::lastmsg, imlog::next, S_IM_LOGS, CitContext::user, ctdluser::usernum, and imlog::usernums.
Referenced by instmsg_shutdown(), and instmsg_timer().
void flush_individual_conversation | ( | struct imlog * | im | ) |
Definition at line 376 of file serv_instmsg.c.
References CtdlMessage::cm_anon_type, CtdlMessage::cm_format_type, CM_Free(), CtdlMessage::cm_magic, CM_SetAsFieldSB(), CM_SetField(), imlog::conversation, CtdlCreateRoom(), CtdlGetConfigStr(), CTDLMESSAGE_MAGIC, CtdlSaveMsgPointerInRoom(), CtdlSubmitMsg(), eAuthor, eMesageText, eOriginalRoom, eRecipient, FMT_RFC822, malloc(), MES_NORMAL, PAGELOGROOM, ROOMNAMELEN, imlog::usernames, and imlog::usernums.
Referenced by flush_conversations_to_disk().
void instmsg_shutdown | ( | void | ) |
Definition at line 519 of file serv_instmsg.c.
References flush_conversations_to_disk().
Referenced by ctdl_module_init_instmsg().
void instmsg_timer | ( | void | ) |
Definition at line 514 of file serv_instmsg.c.
References flush_conversations_to_disk().
Referenced by ctdl_module_init_instmsg().
void log_instant_message | ( | struct CitContext * | me, |
struct CitContext * | them, | ||
char * | msgtext, | ||
int | serial_number | ||
) |
Definition at line 45 of file serv_instmsg.c.
References begin_critical_section(), imlog::conversation, end_critical_section(), ctdluser::fullname, imlist, imlog::last_serial, imlog::lastmsg, malloc(), imlog::next, S_IM_LOGS, CitContext::user, imlog::usernames, ctdluser::usernum, and imlog::usernums.
Referenced by send_instant_message().
int send_instant_message | ( | char * | lun, |
char * | lem, | ||
char * | x_user, | ||
char * | x_msg | ||
) |
Definition at line 197 of file serv_instmsg.c.
References add_xmsg_to_context(), begin_critical_section(), CitContext::can_receive_im, CC, ContextList, CitContext::disable_exp, EM_BROADCAST, end_critical_section(), ExpressMessage::flags, ctdluser::fullname, log_instant_message(), malloc(), CitContext::next, S_SESSION_TABLE, ExpressMessage::sender, ExpressMessage::sender_email, ExpressMessage::text, ExpressMessage::timestamp, and CitContext::user.
Referenced by ctdl_module_init_instmsg().
struct imlog* imlist = NULL |
Definition at line 42 of file serv_instmsg.c.
Referenced by flush_conversations_to_disk(), and log_instant_message().