diff options
Diffstat (limited to 'src/core')
38 files changed, 240 insertions, 274 deletions
diff --git a/src/core/bs_info.c b/src/core/bs_info.c index 4f65d990d..ff7c2c932 100644 --- a/src/core/bs_info.c +++ b/src/core/bs_info.c @@ -61,7 +61,7 @@ class CommandBSInfo : public Command int need_comma = 0; char buf[BUFSIZE], *end; - const char *commastr = getstring(u->na, COMMA_SPACE); + const char *commastr = getstring(u, COMMA_SPACE); if ((bi = findbot(query))) { @@ -74,7 +74,7 @@ class CommandBSInfo : public Command strftime_lang(buf, sizeof(buf), u, STRFTIME_DATE_TIME_FORMAT, tm); notice_lang(s_BotServ, u, BOT_INFO_BOT_CREATED, buf); notice_lang(s_BotServ, u, BOT_INFO_BOT_OPTIONS, - getstring(u->na, + getstring(u, (bi-> flags & BI_PRIVATE) ? BOT_INFO_OPT_PRIVATE : BOT_INFO_OPT_NONE)); @@ -104,137 +104,137 @@ class CommandBSInfo : public Command if (ci->botflags & BS_KICK_BADWORDS) { if (ci->ttb[TTB_BADWORDS]) notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_BADWORDS_BAN, - getstring(u->na, BOT_INFO_ACTIVE), + getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_BADWORDS]); else notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_BADWORDS, - getstring(u->na, BOT_INFO_ACTIVE)); + getstring(u, BOT_INFO_ACTIVE)); } else notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_BADWORDS, - getstring(u->na, BOT_INFO_INACTIVE)); + getstring(u, BOT_INFO_INACTIVE)); if (ci->botflags & BS_KICK_BOLDS) { if (ci->ttb[TTB_BOLDS]) notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_BOLDS_BAN, - getstring(u->na, BOT_INFO_ACTIVE), + getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_BOLDS]); else notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_BOLDS, - getstring(u->na, BOT_INFO_ACTIVE)); + getstring(u, BOT_INFO_ACTIVE)); } else notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_BOLDS, - getstring(u->na, BOT_INFO_INACTIVE)); + getstring(u, BOT_INFO_INACTIVE)); if (ci->botflags & BS_KICK_CAPS) { if (ci->ttb[TTB_CAPS]) notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_CAPS_BAN, - getstring(u->na, BOT_INFO_ACTIVE), + getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_CAPS], ci->capsmin, ci->capspercent); else notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_CAPS_ON, - getstring(u->na, BOT_INFO_ACTIVE), ci->capsmin, + getstring(u, BOT_INFO_ACTIVE), ci->capsmin, ci->capspercent); } else notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_CAPS_OFF, - getstring(u->na, BOT_INFO_INACTIVE)); + getstring(u, BOT_INFO_INACTIVE)); if (ci->botflags & BS_KICK_COLORS) { if (ci->ttb[TTB_COLORS]) notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_COLORS_BAN, - getstring(u->na, BOT_INFO_ACTIVE), + getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_COLORS]); else notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_COLORS, - getstring(u->na, BOT_INFO_ACTIVE)); + getstring(u, BOT_INFO_ACTIVE)); } else notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_COLORS, - getstring(u->na, BOT_INFO_INACTIVE)); + getstring(u, BOT_INFO_INACTIVE)); if (ci->botflags & BS_KICK_FLOOD) { if (ci->ttb[TTB_FLOOD]) notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_FLOOD_BAN, - getstring(u->na, BOT_INFO_ACTIVE), + getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_FLOOD], ci->floodlines, ci->floodsecs); else notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_FLOOD_ON, - getstring(u->na, BOT_INFO_ACTIVE), + getstring(u, BOT_INFO_ACTIVE), ci->floodlines, ci->floodsecs); } else notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_FLOOD_OFF, - getstring(u->na, BOT_INFO_INACTIVE)); + getstring(u, BOT_INFO_INACTIVE)); if (ci->botflags & BS_KICK_REPEAT) { if (ci->ttb[TTB_REPEAT]) notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_REPEAT_BAN, - getstring(u->na, BOT_INFO_ACTIVE), + getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_REPEAT], ci->repeattimes); else notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_REPEAT_ON, - getstring(u->na, BOT_INFO_ACTIVE), + getstring(u, BOT_INFO_ACTIVE), ci->repeattimes); } else notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_REPEAT_OFF, - getstring(u->na, BOT_INFO_INACTIVE)); + getstring(u, BOT_INFO_INACTIVE)); if (ci->botflags & BS_KICK_REVERSES) { if (ci->ttb[TTB_REVERSES]) notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_REVERSES_BAN, - getstring(u->na, BOT_INFO_ACTIVE), + getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_REVERSES]); else notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_REVERSES, - getstring(u->na, BOT_INFO_ACTIVE)); + getstring(u, BOT_INFO_ACTIVE)); } else notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_REVERSES, - getstring(u->na, BOT_INFO_INACTIVE)); + getstring(u, BOT_INFO_INACTIVE)); if (ci->botflags & BS_KICK_UNDERLINES) { if (ci->ttb[TTB_UNDERLINES]) notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_UNDERLINES_BAN, - getstring(u->na, BOT_INFO_ACTIVE), + getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_UNDERLINES]); else notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_UNDERLINES, - getstring(u->na, BOT_INFO_ACTIVE)); + getstring(u, BOT_INFO_ACTIVE)); } else notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_UNDERLINES, - getstring(u->na, BOT_INFO_INACTIVE)); + getstring(u, BOT_INFO_INACTIVE)); end = buf; *end = 0; if (ci->botflags & BS_DONTKICKOPS) { end += snprintf(end, sizeof(buf) - (end - buf), "%s", - getstring(u->na, BOT_INFO_OPT_DONTKICKOPS)); + getstring(u, BOT_INFO_OPT_DONTKICKOPS)); need_comma = 1; } if (ci->botflags & BS_DONTKICKVOICES) { end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? commastr : "", - getstring(u->na, BOT_INFO_OPT_DONTKICKVOICES)); + getstring(u, BOT_INFO_OPT_DONTKICKVOICES)); need_comma = 1; } if (ci->botflags & BS_FANTASY) { end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? commastr : "", - getstring(u->na, BOT_INFO_OPT_FANTASY)); + getstring(u, BOT_INFO_OPT_FANTASY)); need_comma = 1; } if (ci->botflags & BS_GREET) { end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? commastr : "", - getstring(u->na, BOT_INFO_OPT_GREET)); + getstring(u, BOT_INFO_OPT_GREET)); need_comma = 1; } if (ci->botflags & BS_NOBOT) { end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? commastr : "", - getstring(u->na, BOT_INFO_OPT_NOBOT)); + getstring(u, BOT_INFO_OPT_NOBOT)); need_comma = 1; } if (ci->botflags & BS_SYMBIOSIS) { end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? commastr : "", - getstring(u->na, BOT_INFO_OPT_SYMBIOSIS)); + getstring(u, BOT_INFO_OPT_SYMBIOSIS)); need_comma = 1; } notice_lang(s_BotServ, u, BOT_INFO_CHAN_OPTIONS, - *buf ? buf : getstring(u->na, BOT_INFO_OPT_NONE)); + *buf ? buf : getstring(u, BOT_INFO_OPT_NONE)); } else notice_lang(s_BotServ, u, BOT_INFO_NOT_FOUND, query); diff --git a/src/core/bs_kick.c b/src/core/bs_kick.c index 87ef4111a..53485f011 100644 --- a/src/core/bs_kick.c +++ b/src/core/bs_kick.c @@ -44,7 +44,7 @@ class CommandBSKick : public Command notice_lang(s_BotServ, u, CHAN_X_NOT_REGISTERED, chan); else if (ci->flags & CI_FORBIDDEN) notice_lang(s_BotServ, u, CHAN_X_FORBIDDEN, chan); - else if (!check_access(u, ci, CA_SET) && !u->na->nc->HasCommand("botserv/administration")) + else if (!check_access(u, ci, CA_SET) && !u->nc->HasCommand("botserv/administration")) notice_lang(s_BotServ, u, ACCESS_DENIED); else if (!ci->bi) notice_help(s_BotServ, u, BOT_NOT_ASSIGNED); diff --git a/src/core/cs_akick.c b/src/core/cs_akick.c index 4bd2b10bd..a0efdc067 100644 --- a/src/core/cs_akick.c +++ b/src/core/cs_akick.c @@ -82,7 +82,7 @@ int akick_list(User * u, int index, ChannelInfo * ci, int *sent_header) ((akick->flags & AK_ISNICK) ? akick->u.nc-> display : akick->u.mask), (akick->reason ? akick-> - reason : getstring(u->na, NO_REASON))); + reason : getstring(u, NO_REASON))); return 1; } @@ -113,7 +113,7 @@ int akick_view(User * u, int index, ChannelInfo * ci, int *sent_header) strftime_lang(timebuf, sizeof(timebuf), u, STRFTIME_SHORT_DATE_FORMAT, &tm); } else { - snprintf(timebuf, sizeof(timebuf), "%s", getstring(u->na, UNKNOWN)); + snprintf(timebuf, sizeof(timebuf), "%s", getstring(u, UNKNOWN)); } notice_lang(s_ChanServ, u, @@ -122,11 +122,11 @@ int akick_view(User * u, int index, ChannelInfo * ci, int *sent_header) CHAN_AKICK_VIEW_FORMAT), index + 1, ((akick->flags & AK_ISNICK) ? akick->u.nc-> display : akick->u.mask), - akick->creator ? akick->creator : getstring(u->na, + akick->creator ? akick->creator : getstring(u, UNKNOWN), timebuf, (akick->reason ? akick-> - reason : getstring(u->na, NO_REASON))); + reason : getstring(u, NO_REASON))); return 1; } diff --git a/src/core/cs_help.c b/src/core/cs_help.c index eadc0ea8f..17ec5fe4c 100644 --- a/src/core/cs_help.c +++ b/src/core/cs_help.c @@ -52,7 +52,7 @@ class CommandCSHelp : public Command { notice_help(s_ChanServ, u, CHAN_HELP_LEVELS_DESC_FORMAT, levelinfo_maxwidth, levelinfo[i].name, - getstring(u->na, levelinfo[i].desc)); + getstring(u, levelinfo[i].desc)); } } else diff --git a/src/core/cs_info.c b/src/core/cs_info.c index 4bb8495e4..09d92e84f 100644 --- a/src/core/cs_info.c +++ b/src/core/cs_info.c @@ -28,11 +28,11 @@ void myChanServHelp(User * u) class CommandCSInfo : public Command { // cannot be const, as it is modified. - void CheckOptStr(std::string &buf, int opt, const std::string &str, ChannelInfo *ci, NickAlias *na) + void CheckOptStr(std::string &buf, int opt, const std::string &str, ChannelInfo *ci, NickCore *nc) { if (ci->flags & opt) { - const char *commastr = getstring(na, COMMA_SPACE); + const char *commastr = getstring(nc, COMMA_SPACE); if (!buf.empty()) buf += commastr; @@ -69,7 +69,7 @@ class CommandCSInfo : public Command notice_lang(s_ChanServ, u, CHAN_X_FORBIDDEN_OPER, chan, ci->forbidby, (ci->forbidreason ? ci-> - forbidreason : getstring(u->na, NO_REASON))); + forbidreason : getstring(u, NO_REASON))); else notice_lang(s_ChanServ, u, CHAN_X_FORBIDDEN, chan); @@ -115,19 +115,19 @@ class CommandCSInfo : public Command notice_lang(s_ChanServ, u, CHAN_INFO_BANTYPE, ci->bantype); std::string optbuf; - CheckOptStr(optbuf, CI_KEEPTOPIC, getstring(u->na, CHAN_INFO_OPT_KEEPTOPIC), ci, u->na); - CheckOptStr(optbuf, CI_OPNOTICE, getstring(u->na, CHAN_INFO_OPT_OPNOTICE), ci, u->na); - CheckOptStr(optbuf, CI_PEACE, getstring(u->na, CHAN_INFO_OPT_PEACE), ci, u->na); - CheckOptStr(optbuf, CI_PRIVATE, getstring(u->na, CHAN_INFO_OPT_PRIVATE), ci, u->na); - CheckOptStr(optbuf, CI_RESTRICTED, getstring(u->na, CHAN_INFO_OPT_RESTRICTED), ci, u->na); - CheckOptStr(optbuf, CI_SECURE, getstring(u->na, CHAN_INFO_OPT_SECURE), ci, u->na); - CheckOptStr(optbuf, CI_SECUREFOUNDER, getstring(u->na, CHAN_INFO_OPT_SECUREFOUNDER), ci, u->na); - CheckOptStr(optbuf, CI_SECUREOPS, getstring(u->na, CHAN_INFO_OPT_SECUREOPS), ci, u->na); - CheckOptStr(optbuf, CI_SIGNKICK | CI_SIGNKICK_LEVEL, getstring(u->na, CHAN_INFO_OPT_SIGNKICK), ci, u->na); - CheckOptStr(optbuf, CI_TOPICLOCK, getstring(u->na, CHAN_INFO_OPT_TOPICLOCK), ci, u->na); - CheckOptStr(optbuf, CI_XOP, getstring(u->na, CHAN_INFO_OPT_XOP), ci, u->na); - - notice_lang(s_ChanServ, u, CHAN_INFO_OPTIONS, optbuf.empty() ? getstring(u->na, CHAN_INFO_OPT_NONE) : optbuf.c_str()); + CheckOptStr(optbuf, CI_KEEPTOPIC, getstring(u, CHAN_INFO_OPT_KEEPTOPIC), ci, u->nc); + CheckOptStr(optbuf, CI_OPNOTICE, getstring(u, CHAN_INFO_OPT_OPNOTICE), ci, u->nc); + CheckOptStr(optbuf, CI_PEACE, getstring(u, CHAN_INFO_OPT_PEACE), ci, u->nc); + CheckOptStr(optbuf, CI_PRIVATE, getstring(u, CHAN_INFO_OPT_PRIVATE), ci, u->nc); + CheckOptStr(optbuf, CI_RESTRICTED, getstring(u, CHAN_INFO_OPT_RESTRICTED), ci, u->nc); + CheckOptStr(optbuf, CI_SECURE, getstring(u, CHAN_INFO_OPT_SECURE), ci, u->nc); + CheckOptStr(optbuf, CI_SECUREFOUNDER, getstring(u, CHAN_INFO_OPT_SECUREFOUNDER), ci, u->nc); + CheckOptStr(optbuf, CI_SECUREOPS, getstring(u, CHAN_INFO_OPT_SECUREOPS), ci, u->nc); + CheckOptStr(optbuf, CI_SIGNKICK | CI_SIGNKICK_LEVEL, getstring(u, CHAN_INFO_OPT_SIGNKICK), ci, u->nc); + CheckOptStr(optbuf, CI_TOPICLOCK, getstring(u, CHAN_INFO_OPT_TOPICLOCK), ci, u->nc); + CheckOptStr(optbuf, CI_XOP, getstring(u, CHAN_INFO_OPT_XOP), ci, u->nc); + + notice_lang(s_ChanServ, u, CHAN_INFO_OPTIONS, optbuf.empty() ? getstring(u, CHAN_INFO_OPT_NONE) : optbuf.c_str()); notice_lang(s_ChanServ, u, CHAN_INFO_MODE_LOCK, get_mlock_modes(ci, 1)); // XXX: we could just as easily (and tidily) merge this in with the flags display above. @@ -148,7 +148,7 @@ class CommandCSInfo : public Command } if (ci->flags & CI_SUSPENDED) { - notice_lang(s_ChanServ, u, CHAN_X_SUSPENDED, ci->forbidby, (ci->forbidreason ? ci->forbidreason : getstring(u->na, NO_REASON))); + notice_lang(s_ChanServ, u, CHAN_X_SUSPENDED, ci->forbidby, (ci->forbidreason ? ci->forbidreason : getstring(u, NO_REASON))); } if (!show_all && (check_access(u, ci, CA_INFO) || is_servadmin)) diff --git a/src/core/cs_register.c b/src/core/cs_register.c index b632bfa6e..2caeaa567 100644 --- a/src/core/cs_register.c +++ b/src/core/cs_register.c @@ -56,10 +56,6 @@ class CommandCSRegister : public Command notice_lang(s_ChanServ, u, CHAN_SYMBOL_REQUIRED); else if (!ircdproto->IsChannelValid(chan)) notice_lang(s_ChanServ, u, CHAN_X_INVALID, chan); - else if (!u->na || !(nc = u->na->nc)) - notice_lang(s_ChanServ, u, CHAN_MUST_REGISTER_NICK, s_NickServ); - else if (!nick_recognized(u)) - notice_lang(s_ChanServ, u, CHAN_MUST_IDENTIFY_NICK, s_NickServ, s_NickServ); else if (!(c = findchan(chan))) notice_lang(s_ChanServ, u, CHAN_REGISTER_NONE_CHANNEL, chan); else if ((ci = cs_findchan(chan))) diff --git a/src/core/cs_sendpass.c b/src/core/cs_sendpass.c index 0cfef402b..e61f6e2ee 100644 --- a/src/core/cs_sendpass.c +++ b/src/core/cs_sendpass.c @@ -44,24 +44,24 @@ class CommandCSSendPass : public Command { MailInfo *mail; - snprintf(buf, sizeof(buf), getstring2(founder, CHAN_SENDPASS_SUBJECT), ci->name); + snprintf(buf, sizeof(buf), getstring(founder, CHAN_SENDPASS_SUBJECT), ci->name); mail = MailBegin(u, founder, buf, s_ChanServ); if (!mail) return MOD_CONT; - fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_HEAD)); + fprintf(mail->pipe, getstring(founder, CHAN_SENDPASS_HEAD)); fprintf(mail->pipe, "\n\n"); - fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_1), + fprintf(mail->pipe, getstring(founder, CHAN_SENDPASS_LINE_1), ci->name); fprintf(mail->pipe, "\n\n"); - fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_2), + fprintf(mail->pipe, getstring(founder, CHAN_SENDPASS_LINE_2), tmp_pass); fprintf(mail->pipe, "\n\n"); - fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_3)); + fprintf(mail->pipe, getstring(founder, CHAN_SENDPASS_LINE_3)); fprintf(mail->pipe, "\n\n"); - fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_4)); + fprintf(mail->pipe, getstring(founder, CHAN_SENDPASS_LINE_4)); fprintf(mail->pipe, "\n\n"); - fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_5), + fprintf(mail->pipe, getstring(founder, CHAN_SENDPASS_LINE_5), NetworkName); fprintf(mail->pipe, "\n.\n"); diff --git a/src/core/ms_cancel.c b/src/core/ms_cancel.c index 1f24ead6d..48867563e 100644 --- a/src/core/ms_cancel.c +++ b/src/core/ms_cancel.c @@ -46,7 +46,7 @@ class CommandMSCancel : public Command for (i = mi->memos.size() - 1; i >= 0; --i) { - if ((mi->memos[i]->flags & MF_UNREAD) && !stricmp(mi->memos[i]->sender, u->na->nc->display) && (!(mi->memos[i]->flags & MF_NOTIFYS))) + if ((mi->memos[i]->flags & MF_UNREAD) && !stricmp(mi->memos[i]->sender, u->nc->display) && (!(mi->memos[i]->flags & MF_NOTIFYS))) { delmemo(mi, mi->memos[i]->number); notice_lang(s_MemoServ, u, MEMO_CANCELLED, name); diff --git a/src/core/ms_check.c b/src/core/ms_check.c index 0685cdc79..19f376873 100644 --- a/src/core/ms_check.c +++ b/src/core/ms_check.c @@ -57,7 +57,7 @@ class CommandMSCheck : public Command for (i = mi->memos.size() - 1; i >= 0; --i) { - if (!stricmp(mi->memos[i]->sender, u->na->nc->display)) + if (!stricmp(mi->memos[i]->sender, u->nc->display)) { found = 1; /* Yes, we've found the memo */ diff --git a/src/core/ms_del.c b/src/core/ms_del.c index 7d493bffe..cb20a2b22 100644 --- a/src/core/ms_del.c +++ b/src/core/ms_del.c @@ -67,7 +67,7 @@ class CommandMSDel : public Command notice_lang(s_MemoServ, u, NICK_IDENTIFY_REQUIRED, s_NickServ); return MOD_CONT; } - mi = &u->na->nc->memos; + mi = &u->nc->memos; } if (!numstr || (!isdigit(*numstr) && stricmp(numstr, "ALL") && stricmp(numstr, "LAST"))) this->OnSyntaxError(u); diff --git a/src/core/ms_info.c b/src/core/ms_info.c index 2d2ace3ef..68cf9e11d 100644 --- a/src/core/ms_info.c +++ b/src/core/ms_info.c @@ -82,11 +82,11 @@ class CommandMSInfo : public Command notice_lang(s_MemoServ, u, NICK_IDENTIFY_REQUIRED, s_NickServ); return MOD_CONT; } - mi = &u->na->nc->memos; - hardmax = u->na->nc->flags & NI_MEMO_HARDMAX ? 1 : 0; + mi = &u->nc->memos; + hardmax = u->nc->flags & NI_MEMO_HARDMAX ? 1 : 0; } - if (name && (ci || na->nc != u->na->nc)) + if (name && (ci || na->nc != u->nc)) { if (mi->memos.empty()) notice_lang(s_MemoServ, u, MEMO_INFO_X_NO_MEMOS, name); @@ -145,7 +145,7 @@ class CommandMSInfo : public Command notice_lang(s_MemoServ, u, MEMO_INFO_X_NOTIFY_OFF, name); } } - else /* !name || (!ci || na->nc == u->na->nc) */ + else /* !name || (!ci || na->nc == u->nc) */ { if (mi->memos.empty()) notice_lang(s_MemoServ, u, MEMO_INFO_NO_MEMOS); @@ -192,11 +192,11 @@ class CommandMSInfo : public Command notice_lang(s_MemoServ, u, MEMO_INFO_NO_LIMIT); /* Ripped too. But differently because of a seg fault (loughs) */ - if ((u->na->nc->flags & NI_MEMO_RECEIVE) && (u->na->nc->flags & NI_MEMO_SIGNON)) + if ((u->nc->flags & NI_MEMO_RECEIVE) && (u->nc->flags & NI_MEMO_SIGNON)) notice_lang(s_MemoServ, u, MEMO_INFO_NOTIFY_ON); - else if (u->na->nc->flags & NI_MEMO_RECEIVE) + else if (u->nc->flags & NI_MEMO_RECEIVE) notice_lang(s_MemoServ, u, MEMO_INFO_NOTIFY_RECEIVE); - else if (u->na->nc->flags & NI_MEMO_SIGNON) + else if (u->nc->flags & NI_MEMO_SIGNON) notice_lang(s_MemoServ, u, MEMO_INFO_NOTIFY_SIGNON); else notice_lang(s_MemoServ, u, MEMO_INFO_NOTIFY_OFF); diff --git a/src/core/ms_list.c b/src/core/ms_list.c index f3b934c46..4465a2e47 100644 --- a/src/core/ms_list.c +++ b/src/core/ms_list.c @@ -62,7 +62,7 @@ class CommandMSList : public Command notice_lang(s_MemoServ, u, NICK_IDENTIFY_REQUIRED, s_NickServ); return MOD_CONT; } - mi = &u->na->nc->memos; + mi = &u->nc->memos; } if (param && !isdigit(*param) && stricmp(param, "NEW")) this->OnSyntaxError(u); diff --git a/src/core/ms_read.c b/src/core/ms_read.c index 962adf9e4..bf07e30e0 100644 --- a/src/core/ms_read.c +++ b/src/core/ms_read.c @@ -62,7 +62,7 @@ class CommandMSRead : public Command notice_lang(s_MemoServ, u, NICK_IDENTIFY_REQUIRED, s_NickServ); return MOD_CONT; } - mi = &u->na->nc->memos; + mi = &u->nc->memos; } num = numstr ? atoi(numstr) : -1; if (!numstr || (stricmp(numstr, "LAST") && stricmp(numstr, "NEW") && num <= 0)) diff --git a/src/core/ms_rsend.c b/src/core/ms_rsend.c index 9a903264b..cc00d10bf 100644 --- a/src/core/ms_rsend.c +++ b/src/core/ms_rsend.c @@ -34,13 +34,10 @@ class CommandMSRSend : public Command /* prevent user from rsend to themselves */ if ((na = findnick(name))) { - if (u->na) + if (na->nc == u->nc) { - if (!stricmp(na->nc->display, u->na->nc->display)) - { - notice_lang(s_MemoServ, u, MEMO_NO_RSEND_SELF); - return MOD_CONT; - } + notice_lang(s_MemoServ, u, MEMO_NO_RSEND_SELF); + return MOD_CONT; } else { diff --git a/src/core/ms_set.c b/src/core/ms_set.c index 9d92c9388..67d792047 100644 --- a/src/core/ms_set.c +++ b/src/core/ms_set.c @@ -26,26 +26,26 @@ class CommandMSSet : public Command if (!stricmp(param, "ON")) { - u->na->nc->flags |= NI_MEMO_SIGNON | NI_MEMO_RECEIVE; + u->nc->flags |= NI_MEMO_SIGNON | NI_MEMO_RECEIVE; notice_lang(s_MemoServ, u, MEMO_SET_NOTIFY_ON, s_MemoServ); } else if (!stricmp(param, "LOGON")) { - u->na->nc->flags |= NI_MEMO_SIGNON; - u->na->nc->flags &= ~NI_MEMO_RECEIVE; + u->nc->flags |= NI_MEMO_SIGNON; + u->nc->flags &= ~NI_MEMO_RECEIVE; notice_lang(s_MemoServ, u, MEMO_SET_NOTIFY_LOGON, s_MemoServ); } else if (!stricmp(param, "NEW")) { - u->na->nc->flags &= ~NI_MEMO_SIGNON; - u->na->nc->flags |= NI_MEMO_RECEIVE; + u->nc->flags &= ~NI_MEMO_SIGNON; + u->nc->flags |= NI_MEMO_RECEIVE; notice_lang(s_MemoServ, u, MEMO_SET_NOTIFY_NEW, s_MemoServ); } else if (!stricmp(param, "MAIL")) { - if (u->na->nc->email) + if (u->nc->email) { - u->na->nc->flags |= NI_MEMO_MAIL; + u->nc->flags |= NI_MEMO_MAIL; notice_lang(s_MemoServ, u, MEMO_SET_NOTIFY_MAIL); } else @@ -53,12 +53,12 @@ class CommandMSSet : public Command } else if (!stricmp(param, "NOMAIL")) { - u->na->nc->flags &= ~NI_MEMO_MAIL; + u->nc->flags &= ~NI_MEMO_MAIL; notice_lang(s_MemoServ, u, MEMO_SET_NOTIFY_NOMAIL); } else if (!stricmp(param, "OFF")) { - u->na->nc->flags &= ~(NI_MEMO_SIGNON | NI_MEMO_RECEIVE); + u->nc->flags &= ~(NI_MEMO_SIGNON | NI_MEMO_RECEIVE); notice_lang(s_MemoServ, u, MEMO_SET_NOTIFY_OFF, s_MemoServ); } else @@ -73,7 +73,7 @@ class CommandMSSet : public Command const char *p3 = params.size() > 3 ? params[3].c_str() : NULL; const char *user = NULL, *chan = NULL; int32 limit; - NickAlias *na = u->na; + NickCore *nc = u->nc; ChannelInfo *ci = NULL; int is_servadmin = is_services_admin(u); @@ -104,6 +104,7 @@ class CommandMSSet : public Command { if (p2 && stricmp(p2, "HARD") && !chan) { + NickAlias *na; if (!(na = findnick(p1))) { notice_lang(s_MemoServ, u, NICK_X_NOT_REGISTERED, p1); @@ -111,6 +112,7 @@ class CommandMSSet : public Command } user = p1; mi = &na->nc->memos; + nc = na->nc; p1 = p2; p2 = p3; } @@ -134,9 +136,9 @@ class CommandMSSet : public Command else { if (p2) - na->nc->flags |= NI_MEMO_HARDMAX; + nc->flags |= NI_MEMO_HARDMAX; else - na->nc->flags &= ~NI_MEMO_HARDMAX; + nc->flags &= ~NI_MEMO_HARDMAX; } limit = atoi(p1); if (limit < 0 || limit > 32767) @@ -158,7 +160,7 @@ class CommandMSSet : public Command notice_lang(s_MemoServ, u, MEMO_SET_LIMIT_FORBIDDEN, chan); return MOD_CONT; } - else if (!chan && (na->nc->flags & NI_MEMO_HARDMAX)) { + else if (!chan && (nc->flags & NI_MEMO_HARDMAX)) { notice_lang(s_MemoServ, u, MEMO_SET_YOUR_LIMIT_FORBIDDEN); return MOD_CONT; } @@ -182,21 +184,21 @@ class CommandMSSet : public Command mi->memomax = limit; if (limit > 0) { - if (!chan && na->nc == u->na->nc) + if (!chan && nc == u->nc) notice_lang(s_MemoServ, u, MEMO_SET_YOUR_LIMIT, limit); else notice_lang(s_MemoServ, u, MEMO_SET_LIMIT, chan ? chan : user, limit); } else if (!limit) { - if (!chan && na->nc == u->na->nc) + if (!chan && nc == u->nc) notice_lang(s_MemoServ, u, MEMO_SET_YOUR_LIMIT_ZERO); else notice_lang(s_MemoServ, u, MEMO_SET_LIMIT_ZERO, chan ? chan : user); } else { - if (!chan && na->nc == u->na->nc) + if (!chan && nc == u->nc) notice_lang(s_MemoServ, u, MEMO_UNSET_YOUR_LIMIT); else notice_lang(s_MemoServ, u, MEMO_UNSET_LIMIT, @@ -212,7 +214,7 @@ class CommandMSSet : public Command CommandReturn Execute(User *u, std::vector<std::string> ¶ms) { const char *cmd = params[0].c_str(); - MemoInfo *mi = &u->na->nc->memos; + MemoInfo *mi = &u->nc->memos; if (readonly) { diff --git a/src/core/ns_access.c b/src/core/ns_access.c index 07fce81a4..7afeb1559 100644 --- a/src/core/ns_access.c +++ b/src/core/ns_access.c @@ -20,32 +20,34 @@ void myNickServHelp(User *u); class CommandNSAccess : public Command { private: - CommandReturn DoServAdminList(User *u, std::vector<std::string> ¶ms, NickAlias *na) + CommandReturn DoServAdminList(User *u, std::vector<std::string> ¶ms, NickCore *nc) { const char *mask = params.size() > 2 ? params[2].c_str() : NULL; char **access; int i; - if (!na->nc->accesscount) + if (!nc->accesscount) { - notice_lang(s_NickServ, u, NICK_ACCESS_LIST_X_EMPTY, na->nick); + notice_lang(s_NickServ, u, NICK_ACCESS_LIST_X_EMPTY, nc->display); return MOD_CONT; } +/* reinstate when forbidden is moved to a group flag if (na->status & NS_FORBIDDEN) { notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, na->nick); return MOD_CONT; } +*/ - if (na->nc->flags & NI_SUSPENDED) + if (nc->flags & NI_SUSPENDED) { - notice_lang(s_NickServ, u, NICK_X_SUSPENDED, na->nick); + notice_lang(s_NickServ, u, NICK_X_SUSPENDED, nc->display); return MOD_CONT; |
