Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

memoserv.c File Reference

Memo/messaging service. More...

#include "services.h"
#include "memoserv.h"
#include "nickserv.h"
#include "chanserv.h"
#include "queue.h"
#include "macro.h"
#include "log.h"
#include "hash/md5pw.h"

Go to the source code of this file.

Defines

#define CMD_REGIDENT   (CMD_REG|CMD_IDENT)
 Nick is registered and user is identified to that nickname.


Functions

cmd_return ms_help (UserList *nick, char **args, int numargs)
cmd_return ms_read (UserList *nick, char **args, int numargs)
cmd_return ms_savememo (UserList *nick, char **args, int numargs)
cmd_return ms_send (UserList *nick, char **args, int numargs)
cmd_return ms_forward (UserList *nick, char **args, int numargs)
 Forward future memos to another nick.

cmd_return ms_nomemo (UserList *nick, char **args, int numargs)
cmd_return ms_clean (UserList *nick, char **args, int numargs)
cmd_return ms_delete (UserList *nick, char **args, int numargs)
 Delete a memo (message handler).

cmd_return ms_list (UserList *nick, char **args, int numargs)
cmd_return ms_unsend (UserList *nick, char **args, int numargs)
cmd_return ms_mblock (UserList *nick, char **args, int numargs)
 Block further memos from a registered nickname.

int ms_sendMemo (char *, char *, RegNickList *, const char *, char *, UserList *)
 Sends a memo out, can fail according to NOMEMO, MBLOCK, Max memos, and other restrictions.

cmd_return ms_AddMemoBlock (UserList *, char *)
 Create a memo block.

cmd_return ms_DelMemoBlock (UserList *, char *)
 Delete a memo block.

char NickGetEnc (RegNickList *)
 Get a registered nick encryption prefix.

void sendToMemoServ (UserList *nick, char **args, int numargs)
 Parse a MemoServ message.

cmd_return ui_ms_send (UserList *nick, int numargs, char *args[], int level)
 User-interface for memo sending.

cmd_return ms_sendsop (UserList *nick, char **args, int numargs)
 /ms sendsop message handler

void cleanMemos (UserList *nick)
 cleanMemos() - clean a user's memobox of deleted entries

void delMemo (MemoBox *mbox, MemoList *memo)
 Deletes a user's memo.

void checkMemos (UserList *nick)
 Generates user memo stats for display during signon.

MemoBlockgetMemoBlockData (MemoBox *box, RegNickList *senderRnl)
 Get information about a memo block.

void delMemoBlock (MemoBox *box, MemoBlock *zap)
 Destroy a memo block record.

void addMemoBlock (MemoBox *box, MemoBlock *mblock)
 Add a new memo block record to a list.

int ShouldMemoExpire (MemoList *memo, int vacationPlus)
 Should a memo expire or no?


Variables

interp::service_cmd_t memoserv_commands []
 Dispatch table for handling MemoServ commands.


Detailed Description

Memo/messaging service.

System for sending messages to offline/online registered users

Author:
Chip Norkus

Max Byrd

Greg Poma

James Hess

Date:
2001-2002
Id
memoserv.c,v 1.3 2003/08/23 02:03:24 Mysid Exp

Definition in file memoserv.c.


Function Documentation

void addMemoBlock MemoBox box,
MemoBlock mblock
 

Add a new memo block record to a list.

Parameters:
box Pointer to a memo box item
zap Pointer to a memo block item to be added to the list

Definition at line 1257 of file memoserv.c.

void checkMemos UserList nick  ) 
 

Generates user memo stats for display during signon.

Parameters:
nick Pointer to an online user item

Definition at line 990 of file memoserv.c.

References MEMO_DELETE, MEMO_FWD, MEMO_REPLY, MEMO_SAVE, and MEMO_UNREAD.

Referenced by NickSeeUser(), and parseLine().

void cleanMemos UserList nick  ) 
 

cleanMemos() - clean a user's memobox of deleted entries

Parameters:
nick Pointer to an online user item

Definition at line 954 of file memoserv.c.

Referenced by remUser().

void delMemo MemoBox mbox,
MemoList memo
 

Deletes a user's memo.

Parameters:
mbox Pointer to a user memobox
memo Pointer to a user memobox entry item (memo)

Definition at line 978 of file memoserv.c.

Referenced by delRegNick().

void delMemoBlock MemoBox box,
MemoBlock zap
 

Destroy a memo block record.

Parameters:
box Pointer to a memo box item
zap Pointer to a memo block item to be deleted
Warning:
After execution, 'zap' is no longer a valid pointer value

Definition at line 1232 of file memoserv.c.

References _memolist::flags, MEMO_DELETE, MEMO_SAVE, MEMO_UNREAD, and _memolist::sent.

MemoBlock* getMemoBlockData MemoBox box,
RegNickList *  senderRnl
 

Get information about a memo block.

Parameters:
box Pointer to a memo box item
text Nickname to search for a block against

Definition at line 1054 of file memoserv.c.

References MemoServ, _userlist::nick, PutReply, and RET_FAIL.

Referenced by ms_DelMemoBlock().

cmd_return ms_AddMemoBlock UserList nick,
char *  text
[static]
 

Create a memo block.

Parameters:
nick Pointer to an online nick item
text Nickname to add to a memo block list

Definition at line 1179 of file memoserv.c.

References RET_OK_DB.

cmd_return ms_DelMemoBlock UserList nick,
char *  text
[static]
 

Delete a memo block.

Parameters:
nick Pointer to an online nick item
text Nickname to remove from a memo block list

Definition at line 1141 of file memoserv.c.

References corelog, getMemoBlockData(), getRegNickData(), logDump(), MemoServ, memoblocklist_struct::next, _userlist::nick, PutReply, _userlist::reg, RET_FAIL, and RET_NOTARGET.

int ms_sendMemo char *  sender,
char *  memo,
RegNickList *  sendto,
const char *  to,
char *  tochan,
UserList senderptr
 

Sends a memo out, can fail according to NOMEMO, MBLOCK, Max memos, and other restrictions.

Parameters:
sender Nickname of that who sent the message
memo Message text
sendto Pointer to registered nickname of recipient
to Recipient nickname
senderptr Pointer to online user item of memo sender
Returns:
-1 on failure, 0 on success
Warning:
The value of the 'memo' pointer is stored on the sent memo structure
make certain the nickname we are sending to is registered.

Bug:
XXX Why isn't this done before we ever get here?

Definition at line 518 of file memoserv.c.

char NickGetEnc RegNickList *  rnl  ) 
 

Get a registered nick encryption prefix.

Returns:
$ for encrypted or @ for plaintext

Definition at line 400 of file nickserv.c.

Referenced by IpcType::alterRegNickMessage(), IpcType::authObjMessage(), and IpcType::makeMessage().

void sendToMemoServ UserList nick,
char **  args,
int  numargs
 

Parse a MemoServ message.

Parameters:
tmp Pointer to online user initiating the message
args Args of the message, where args[0] is the command and the extra parameters follow
numargs Highest index in the args[] array passed plus 1. so args[numargs - 1] is the highest index that can be safely accessed.

Definition at line 110 of file memoserv.c.

References ADD_MEMO_BOX, CTime, getOpFlags(), MemoServ, memoserv_commands, nextMsync, PutHelpInfo, PutReply, _userlist::reg, RET_FAIL, and RET_OK_DB.

Referenced by parseLine().

cmd_return ui_ms_send UserList nick,
int  numargs,
char *  args[],
int  level
 

User-interface for memo sending.

Bug:
XXX what a hack...

Definition at line 356 of file memoserv.c.

References MemoServ, PutReply, and RET_SYNTAX.


Variable Documentation

interp::service_cmd_t memoserv_commands[]
 

Initial value:

 {
  
   { "help",        ms_help,    0, LOG_NO,  0, 3 },
   { "read",        ms_read,    0, LOG_NO,  CMD_REGIDENT, 7 },
   { "save",        ms_savememo,    0, LOG_NO,  CMD_REGIDENT, 7 },
   { "list",        ms_list,    0, LOG_NO,  CMD_REGIDENT, 7 },
   { "send",        ms_send,    0, LOG_NO,  CMD_REGIDENT, 9 },
   { "sendaop",     ms_send,    0, LOG_NO,  CMD_REGIDENT, 9 },
   { "sendsop",     ms_send,    0, LOG_NO,  CMD_REGIDENT, 9 },
   { "sendvop",     ms_send,    0, LOG_NO,  CMD_REGIDENT, 9 },
   { "del",         ms_delete,  0, LOG_NO,  CMD_REGIDENT, 5 },
   { "delete",      ms_delete,  0, LOG_NO,  CMD_REGIDENT, 5 },
   { "purge",       ms_clean,   0, LOG_NO,  CMD_REGIDENT, 5 },
   { "clean",       ms_clean,   0, LOG_NO,  CMD_REGIDENT, 5 },
   { "forward",     ms_forward, 0, LOG_NO,  CMD_REGIDENT, 5 },
   { "nomemo",      ms_nomemo,  0, LOG_NO,  CMD_REGIDENT, 5 },
   { "unsend",      ms_unsend,  0, LOG_NO,  CMD_REGIDENT, 5 },
   { "mblock",      ms_mblock,  0, LOG_NO,  CMD_REGIDENT, 5 },
   { NULL,      NULL,       0, LOG_NO,  0, 0 }
}
Dispatch table for handling MemoServ commands.

Definition at line 79 of file memoserv.c.

Referenced by sendToMemoServ().


Generated at Sat Oct 25 20:56:11 2003 for Services using Doxygen.
Services Copyr. 1996-2001 Chip Norkus, Max Byrd, Greg Poma, Michael Graff, James Hess, Dafydd James. All rights reserved See LICENSE for licensing information.