41 c =
createCommand(
"SET NOTIFY", NULL, NULL, MEMO_HELP_SET_NOTIFY, -1,
45 c =
createCommand(
"SET LIMIT", NULL, NULL, -1, MEMO_HELP_SET_LIMIT,
46 MEMO_SERVADMIN_HELP_SET_LIMIT,
47 MEMO_SERVADMIN_HELP_SET_LIMIT,
48 MEMO_SERVADMIN_HELP_SET_LIMIT);
56 alog(
"[\002ms_set\002] Can't hook to EVENT_RELOAD event");
89 char *cmd = strtok(NULL,
" ");
90 char *param = strtok(NULL,
"");
102 }
else if (
stricmp(cmd,
"NOTIFY") == 0) {
104 }
else if (
stricmp(cmd,
"LIMIT") == 0) {
120 if (
stricmp(param,
"ON") == 0) {
122 alog(
"%s: %s!%s@%s set notify to ON",
125 }
else if (
stricmp(param,
"LOGON") == 0) {
128 alog(
"%s: %s!%s@%s set notify to LOGON",
131 }
else if (
stricmp(param,
"NEW") == 0) {
134 alog(
"%s: %s!%s@%s set notify to NEW",
137 }
else if (
stricmp(param,
"MAIL") == 0) {
140 alog(
"%s: %s!%s@%s set notify to MAIL",
146 }
else if (
stricmp(param,
"NOMAIL") == 0) {
148 alog(
"%s: %s!%s@%s set notify to NOMAIL",
151 }
else if (
stricmp(param,
"OFF") == 0) {
153 alog(
"%s: %s!%s@%s set notify to OFF",
169 char *p1 = strtok(param,
" ");
170 char *p2 = strtok(NULL,
" ");
171 char *p3 = strtok(NULL,
" ");
172 char *user = NULL, *chan = NULL;
178 if (p1 && *p1 ==
'#') {
182 p3 = strtok(NULL,
" ");
196 if (p2 &&
stricmp(p2,
"HARD") != 0 && !chan) {
207 MEMO_SET_LIMIT_SERVADMIN_SYNTAX);
210 if ((!isdigit(*p1) &&
stricmp(p1,
"NONE") != 0) ||
211 (p2 &&
stricmp(p2,
"HARD") != 0)) {
213 MEMO_SET_LIMIT_SERVADMIN_SYNTAX);
228 if (limit < 0 || limit > 32767) {
235 if (!p1 || p2 || !isdigit(*p1)) {
237 MEMO_SET_LIMIT_SYNTAX);
259 }
else if (limit > 32767) {
266 if (!chan && na->
nc == u->
na->
nc) {
267 alog(
"%s: %s!%s@%s set their memo limit to %d",
271 alog(
"%s: %s!%s@%s set the memo limit for %s to %d",
273 chan ? chan : user, limit);
275 chan ? chan : user, limit);
277 }
else if (limit == 0) {
278 if (!chan && na->
nc == u->
na->
nc) {
279 alog(
"%s: %s!%s@%s set their memo limit to 0",
283 alog(
"%s: %s!%s@%s set the memo limit for %s to 0",
290 if (!chan && na->
nc == u->
na->
nc) {
291 alog(
"%s: %s!%s@%s unset their memo limit",
295 alog(
"%s: %s!%s@%s unset the memo limit for %s",
E NickAlias * findnick(const char *nick)
E int nick_identified(User *u)
E int check_access(User *user, ChannelInfo *ci, int what)
E int stricmp(const char *s1, const char *s2)
static void myMemoServHelp(User *u)
MDE void moduleAddAuthor(const char *author)
E void syntax_error(char *service, User *u, const char *command, int msgnum)
E void notice_lang(char *source, User *dest, int message,...)
MDE void moduleSetType(MODType type)
static int reload_config(int argc, char **argv)
MDE void moduleSetMemoHelp(void(*func)(User *u))
MDE void moduleAddVersion(const char *version)
MDE EvtHook * createEventHook(char *name, int(*func)(int argc, char **argv))
E void alog(const char *fmt,...) FORMAT(printf
E int is_services_admin(User *u)
MDE Command * findCommand(CommandHash *cmdTable[], const char *name)
MDE Command * createCommand(const char *name, int(*func)(User *u), int(*has_priv)(User *u), int help_all, int help_reg, int help_oper, int help_admin, int help_root)
static int do_set(User *u)
int AnopeInit(int argc, char **argv)
E ChannelInfo * cs_findchan(const char *chan)
static int do_set_notify(User *u, MemoInfo *mi, char *param)
static int do_set_limit(User *u, MemoInfo *mi, char *param)
MDE int moduleAddCommand(CommandHash *cmdTable[], Command *c, int pos)
MDE int moduleAddEventHook(EvtHook *evh)