Anope IRC Services  Version 1.8
Functions
memoserv.c File Reference
#include "services.h"
#include "pseudo.h"
Include dependency graph for memoserv.c:

Go to the source code of this file.

Functions

E void moduleAddMemoServCmds (void)
 
static void new_memo_mail (NickCore *nc, Memo *m)
 
E void rsend_notify (User *u, Memo *m, const char *chan)
 
void ms_init (void)
 
void memoserv (User *u, char *buf)
 
void check_memos (User *u)
 
MemoInfogetmemoinfo (const char *name, int *ischan, int *isforbid)
 
void memo_send (User *u, char *name, char *text, int z)
 
void memo_send_from (User *u, char *name, char *text, int z, char *source)
 
int delmemo (MemoInfo *mi, int num)
 

Function Documentation

void check_memos ( User u)

check_memos: See if the given user has any unread memos, and send a NOTICE to that user if so (and if the appropriate flag is set).

Parameters
uUser Struct
Returns
void

Definition at line 86 of file memoserv.c.

References alog(), debug, memo_::flags, nickcore_::flags, MemoInfo::memocount, MemoInfo::memomax, MemoInfo::memos, nickcore_::memos, MF_UNREAD, user_::na, nickalias_::nc, NI_MEMO_SIGNON, nick_recognized(), notice_lang(), memo_::number, and s_MemoServ.

Referenced by anope_event_encap(), anope_event_metadata(), do_group(), do_identify(), do_nick(), do_nickupdate(), and m_away().

int delmemo ( MemoInfo mi,
int  num 
)

Delete a memo by number.

Parameters
miMemoinfo struct
numMemo number to delete
Returns
int 1 if the memo was found, else 0.

Definition at line 364 of file memoserv.c.

References MemoInfo::memocount, MemoInfo::memos, moduleCleanStruct(), memo_::moduleData, memo_::number, and memo_::text.

Referenced by del_memo_callback(), do_cancel(), and do_del().

MemoInfo* getmemoinfo ( const char *  name,
int *  ischan,
int *  isforbid 
)

Return the MemoInfo corresponding to the given nick or channel name.

Parameters
nameName to check
ischan- the result its a channel will be stored in here
isforbid- the result if its forbidden will be stored in here
Returns
`ischan' 1 if the name was a channel name, else 0.
`isforbid' 1 if the name is forbidden, else 0.

Definition at line 144 of file memoserv.c.

References CI_VERBOTEN, cs_findchan(), findnick(), chaninfo_::flags, nickcore_::memos, chaninfo_::memos, nickalias_::nc, NS_VERBOTEN, and nickalias_::status.

Referenced by do_cancel(), and memo_send_from().

void memo_send ( User u,
char *  name,
char *  text,
int  z 
)

Split from do_send, this way we can easily send a memo from any point.

Parameters
uUser Struct
nameTarget of the memo
textMemo Text
ztype see info 0 - reply to user 1 - silent 2 - silent with no delay timer 3 - reply to user and request read receipt
Returns
void

Definition at line 198 of file memoserv.c.

References nickcore_::display, memo_send_from(), user_::na, and nickalias_::nc.

Referenced by do_rsend(), do_send(), do_sendall(), do_staff(), my_memo_lang(), and rsend_notify().

void memo_send_from ( User u,
char *  name,
char *  text,
int  z,
char *  source 
)

Split from do_send, this way we can easily send a memo from any point.

Parameters
uUser Struct
nameTarget of the memo
textMemo Text
ztype see info
sourceNickname of the alias the memo originates from. 0 - reply to user 1 - silent 2 - silent with no delay timer 3 - reply to user and request read receipt
Returns
void

Definition at line 217 of file memoserv.c.

References nickcore_::aliases, c, CA_MEMO, check_access(), checkDefCon(), channel_::ci, slist_::count, DEFCON_NO_NEW_MEMOS, findchan(), findnick(), finduser(), memo_::flags, nickcore_::flags, get_ignore(), getmemoinfo(), is_services_oper(), user_::lastmemosend, slist_::list, MemoInfo::memocount, MemoInfo::memomax, MemoInfo::memos, MF_NOTIFYS, MF_RECEIPT, MF_UNREAD, memo_::moduleData, MSNotifyAll, MSSendDelay, chaninfo_::name, new_memo_mail(), Command_::next, NI_MEMO_MAIL, NI_MEMO_RECEIVE, nick_identified(), nick_recognized(), NICKMAX, notice_lang(), memo_::number, readonly, s_MemoServ, s_NickServ, memo_::sender, srealloc(), sstrdup(), strscpy(), syntax_error(), memo_::text, memo_::time, nickalias_::u, and channel_::users.

Referenced by memo_send(), and my_memo_lang().

void memoserv ( User u,
char *  buf 
)

memoserv: Main MemoServ routine. Note that the User structure passed to the do_* routines will always be valid (non-NULL) and will always have a valid NickInfo pointer in the `ni' field.

Parameters
uUser Struct
bufBuffer containing the privmsg
Returns
void

Definition at line 54 of file memoserv.c.

References anope_cmd_ctcp(), MEMOSERV, mod_run_cmd(), user_::na, user_::nick, notice_lang(), s_MemoServ, s_NickServ, skeleton, and stricmp().

Referenced by m_privmsg().

void moduleAddMemoServCmds ( void  )

Definition at line 26 of file memoserv.c.

References MemoServCoreModules, MemoServCoreNumber, and modules_core_init().

Referenced by ms_init().

void ms_init ( void  )

MemoServ initialization.

Returns
void

Definition at line 38 of file memoserv.c.

References moduleAddMemoServCmds().

Referenced by init_secondary().

static void new_memo_mail ( NickCore nc,
Memo m 
)
static
E void rsend_notify ( User u,
Memo m,
const char *  chan 
)