diff options
author | Naram Qashat <cyberbotx@cyberbotx.com> | 2010-06-26 01:38:19 -0400 |
---|---|---|
committer | Naram Qashat <cyberbotx@cyberbotx.com> | 2010-06-26 01:38:19 -0400 |
commit | 6dc3af5db41ecb24669b259c776c51964539d531 (patch) | |
tree | e710d022742ad2bf0723c5806afd6a3cc091ba62 /src | |
parent | e447933c02eac8013f84cb00751a8e1411ddb1b6 (diff) |
The next of a few "CBX OCDing over code style" commits, focusing on src/core/hs_* and src/core/ms_*, plus some tiny fallout caused by changing the FOREACH_* macros.
Diffstat (limited to 'src')
-rw-r--r-- | src/core/hs_del.cpp | 3 | ||||
-rw-r--r-- | src/core/hs_delall.cpp | 5 | ||||
-rw-r--r-- | src/core/hs_group.cpp | 3 | ||||
-rw-r--r-- | src/core/hs_help.cpp | 5 | ||||
-rw-r--r-- | src/core/hs_list.cpp | 7 | ||||
-rw-r--r-- | src/core/hs_off.cpp | 5 | ||||
-rw-r--r-- | src/core/hs_on.cpp | 5 | ||||
-rw-r--r-- | src/core/hs_set.cpp | 10 | ||||
-rw-r--r-- | src/core/hs_setall.cpp | 9 | ||||
-rw-r--r-- | src/core/ms_cancel.cpp | 7 | ||||
-rw-r--r-- | src/core/ms_check.cpp | 6 | ||||
-rw-r--r-- | src/core/ms_del.cpp | 29 | ||||
-rw-r--r-- | src/core/ms_help.cpp | 6 | ||||
-rw-r--r-- | src/core/ms_info.cpp | 16 | ||||
-rw-r--r-- | src/core/ms_list.cpp | 16 | ||||
-rw-r--r-- | src/core/ms_read.cpp | 16 | ||||
-rw-r--r-- | src/core/ms_rsend.cpp | 19 | ||||
-rw-r--r-- | src/core/ms_send.cpp | 4 | ||||
-rw-r--r-- | src/core/ms_sendall.cpp | 8 | ||||
-rw-r--r-- | src/core/ms_set.cpp | 3 | ||||
-rw-r--r-- | src/core/ms_staff.cpp | 8 | ||||
-rw-r--r-- | src/core/ns_suspend.cpp | 2 |
22 files changed, 70 insertions, 122 deletions
diff --git a/src/core/hs_del.cpp b/src/core/hs_del.cpp index e86db7e81..9944326b0 100644 --- a/src/core/hs_del.cpp +++ b/src/core/hs_del.cpp @@ -7,9 +7,8 @@ * * Based on the original code of Epona by Lara. * Based on the original code of Services by Andy Church. - * - * */ + /*************************************************************************/ #include "module.h" diff --git a/src/core/hs_delall.cpp b/src/core/hs_delall.cpp index 97a09a073..89b3551ae 100644 --- a/src/core/hs_delall.cpp +++ b/src/core/hs_delall.cpp @@ -7,9 +7,8 @@ * * Based on the original code of Epona by Lara. * Based on the original code of Services by Andy Church. - * - * */ + /*************************************************************************/ #include "module.h" @@ -34,7 +33,7 @@ class CommandHSDelAll : public Command } FOREACH_MOD(I_OnDeleteVhost, OnDeleteVhost(na)); NickCore *nc = na->nc; - for (std::list<NickAlias *>::iterator it = nc->aliases.begin(); it != nc->aliases.end(); ++it) + for (std::list<NickAlias *>::iterator it = nc->aliases.begin(), it_end = nc->aliases.end(); it != it_end; ++it) { na = *it; na->hostinfo.RemoveVhost(); diff --git a/src/core/hs_group.cpp b/src/core/hs_group.cpp index d71c4088d..f56015f98 100644 --- a/src/core/hs_group.cpp +++ b/src/core/hs_group.cpp @@ -7,9 +7,8 @@ * * Based on the original code of Epona by Lara. * Based on the original code of Services by Andy Church. - * - * */ + /*************************************************************************/ #include "module.h" diff --git a/src/core/hs_help.cpp b/src/core/hs_help.cpp index 5cc7e5129..a6029d5a0 100644 --- a/src/core/hs_help.cpp +++ b/src/core/hs_help.cpp @@ -7,9 +7,8 @@ * * Based on the original code of Epona by Lara. * Based on the original code of Services by Andy Church. - * - * */ + /*************************************************************************/ #include "module.h" @@ -31,7 +30,7 @@ class CommandHSHelp : public Command void OnSyntaxError(User *u, const ci::string &subcommand) { notice_help(Config.s_HostServ, u, HOST_HELP, Config.s_HostServ); - for (CommandMap::const_iterator it = ChanServ->Commands.begin(); it != ChanServ->Commands.end(); ++it) + for (CommandMap::const_iterator it = HostServ->Commands.begin(), it_end = HostServ->Commands.end(); it != it_end; ++it) it->second->OnServHelp(u); } }; diff --git a/src/core/hs_list.cpp b/src/core/hs_list.cpp index d92822b63..1812c3a54 100644 --- a/src/core/hs_list.cpp +++ b/src/core/hs_list.cpp @@ -7,9 +7,8 @@ * * Based on the original code of Epona by Lara. * Based on the original code of Services by Andy Church. - * - * */ + /*************************************************************************/ #include "module.h" @@ -41,7 +40,7 @@ class CommandHSList : public Command notice_lang(Config.s_HostServ, u, LIST_INCORRECT_RANGE); return MOD_CONT; } - for (unsigned i = 1; i < key.size(); ++i) + for (unsigned i = 1, end = key.size(); i < end; ++i) { if (!isdigit(key[i]) && i != tmp) { @@ -53,7 +52,7 @@ class CommandHSList : public Command } } - for (nickalias_map::const_iterator it = NickAliasList.begin(); it != NickAliasList.end(); ++it) + for (nickalias_map::const_iterator it = NickAliasList.begin(), it_end = NickAliasList.end(); it != it_end; ++it) { NickAlias *na = it->second; diff --git a/src/core/hs_off.cpp b/src/core/hs_off.cpp index 0a483e2a4..64828c2b7 100644 --- a/src/core/hs_off.cpp +++ b/src/core/hs_off.cpp @@ -7,9 +7,8 @@ * * Based on the original code of Epona by Lara. * Based on the original code of Services by Andy Church. - * - * */ + /*************************************************************************/ #include "module.h" @@ -32,7 +31,7 @@ class CommandHSOff : public Command ircdproto->SendVhostDel(u); notice_lang(Config.s_HostServ, u, HOST_OFF); } - + return MOD_CONT; } diff --git a/src/core/hs_on.cpp b/src/core/hs_on.cpp index 4fd415ead..a4514f0a2 100644 --- a/src/core/hs_on.cpp +++ b/src/core/hs_on.cpp @@ -7,9 +7,8 @@ * * Based on the original code of Epona by Lara. * Based on the original code of Services by Andy Church. - * - * */ + /*************************************************************************/ #include "module.h" @@ -46,7 +45,7 @@ class CommandHSOn : public Command } else notice_lang(Config.s_HostServ, u, HOST_NOT_ASSIGNED); - + return MOD_CONT; } diff --git a/src/core/hs_set.cpp b/src/core/hs_set.cpp index 3aeb5c6be..7cba19c21 100644 --- a/src/core/hs_set.cpp +++ b/src/core/hs_set.cpp @@ -7,9 +7,8 @@ * * Based on the original code of Epona by Lara. * Based on the original code of Services by Andy Church. - * - * */ + /*************************************************************************/ #include "module.h" @@ -55,7 +54,6 @@ class CommandHSSet : public Command else { for (s = vIdent; *s; ++s) - { if (!isvalidchar(*s)) { notice_lang(Config.s_HostServ, u, HOST_SET_IDENT_ERROR); @@ -64,7 +62,6 @@ class CommandHSSet : public Command delete [] hostmask; return MOD_CONT; } - } } if (!ircd->vident) { @@ -101,7 +98,6 @@ class CommandHSSet : public Command return MOD_CONT; } - tmp_time = time(NULL); if ((na = findnick(nick))) @@ -117,9 +113,7 @@ class CommandHSSet : public Command delete [] hostmask; return MOD_CONT; } - Alog() << "vHost for user \002" << nick << "\002 set to \002" - << (vIdent && ircd->vident ? vIdent : "") << (vIdent && ircd->vident ? "@" : "") - << hostmask << " \002 by oper \002" << u->nick << "\002"; + Alog() << "vHost for user \002" << nick << "\002 set to \002" << (vIdent && ircd->vident ? vIdent : "") << (vIdent && ircd->vident ? "@" : "") << hostmask << " \002 by oper \002" << u->nick << "\002"; na->hostinfo.SetVhost(vIdent ? vIdent : "", hostmask, u->nick); FOREACH_MOD(I_OnSetVhost, OnSetVhost(na)); diff --git a/src/core/hs_setall.cpp b/src/core/hs_setall.cpp index 88a47dc9a..eddf6202a 100644 --- a/src/core/hs_setall.cpp +++ b/src/core/hs_setall.cpp @@ -7,9 +7,8 @@ * * Based on the original code of Epona by Lara. * Based on the original code of Services by Andy Church. - * - * */ + /*************************************************************************/ #include "module.h" @@ -68,7 +67,6 @@ class CommandHSSetAll : public Command else { for (s = vIdent; *s; ++s) - { if (!isvalidchar(*s)) { notice_lang(Config.s_HostServ, u, HOST_SET_IDENT_ERROR); @@ -77,7 +75,6 @@ class CommandHSSetAll : public Command delete [] hostmask; return MOD_CONT; } - } } if (!ircd->vident) { @@ -117,9 +114,7 @@ class CommandHSSetAll : public Command tmp_time = time(NULL); - Alog() << "vHost for all nicks in group \002" << nick << "\002 set to \002" - << (vIdent && ircd->vident ? vIdent : "") << (vIdent && ircd->vident ? "@" : "") - << hostmask << " \002 by oper \002" << u->nick << "\002"; + Alog() << "vHost for all nicks in group \002" << nick << "\002 set to \002" << (vIdent && ircd->vident ? vIdent : "") << (vIdent && ircd->vident ? "@" : "") << hostmask << " \002 by oper \002" << u->nick << "\002"; na->hostinfo.SetVhost(vIdent ? vIdent : "", hostmask, u->nick); HostServSyncVhosts(na); diff --git a/src/core/ms_cancel.cpp b/src/core/ms_cancel.cpp index 4528134fa..62f3026b7 100644 --- a/src/core/ms_cancel.cpp +++ b/src/core/ms_cancel.cpp @@ -7,9 +7,8 @@ * * Based on the original code of Epona by Lara. * Based on the original code of Services by Andy Church. - * - * */ + /*************************************************************************/ #include "module.h" @@ -44,15 +43,13 @@ class CommandMSCancel : public Command int i; for (i = mi->memos.size() - 1; i >= 0; --i) - { if ((mi->memos[i]->HasFlag(MF_UNREAD)) && !stricmp(mi->memos[i]->sender.c_str(), u->Account()->display) && !mi->memos[i]->HasFlag(MF_NOTIFYS)) { - FOREACH_MOD(I_OnMemoDel, OnMemoDel(findnick(name)->nc, mi, mi->memos[i]->number)) + FOREACH_MOD(I_OnMemoDel, OnMemoDel(findnick(name)->nc, mi, mi->memos[i]->number)); delmemo(mi, mi->memos[i]->number); notice_lang(Config.s_MemoServ, u, MEMO_CANCELLED, name); return MOD_CONT; } - } notice_lang(Config.s_MemoServ, u, MEMO_CANCEL_NONE); } diff --git a/src/core/ms_check.cpp b/src/core/ms_check.cpp index 87d4a4417..90e45ebaa 100644 --- a/src/core/ms_check.cpp +++ b/src/core/ms_check.cpp @@ -7,9 +7,8 @@ * * Based on the original code of Epona by Lara. * Based on the original code of Services by Andy Church. - * - * */ + /*************************************************************************/ #include "module.h" @@ -41,7 +40,7 @@ class CommandMSCheck : public Command return MOD_CONT; } - if ((na->HasFlag(NS_FORBIDDEN))) + if (na->HasFlag(NS_FORBIDDEN)) { notice_lang(Config.s_MemoServ, u, NICK_X_FORBIDDEN, recipient); return MOD_CONT; @@ -100,6 +99,7 @@ class MSCheck : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); + this->AddCommand(MemoServ, new CommandMSCheck()); } }; diff --git a/src/core/ms_del.cpp b/src/core/ms_del.cpp index e10b7f3fb..507f410af 100644 --- a/src/core/ms_del.cpp +++ b/src/core/ms_del.cpp @@ -7,9 +7,8 @@ * * Based on the original code of Epona by Lara. * Based on the original code of Services by Andy Church. - * - * */ + /*************************************************************************/ #include "module.h" @@ -30,13 +29,9 @@ class MemoDelCallback : public NumberList return; if (ci) - { FOREACH_MOD(I_OnMemoDel, OnMemoDel(ci, mi, Number - 1)); - } else - { FOREACH_MOD(I_OnMemoDel, OnMemoDel(u->Account(), mi, Number - 1)); - } delmemo(mi, Number - 1); } @@ -54,7 +49,7 @@ class CommandMSDel : public Command MemoInfo *mi; ChannelInfo *ci = NULL; ci::string numstr = params.size() ? params[0] : "", chan; - unsigned i; + unsigned i, end; int last; if (!numstr.empty() && numstr[0] == '#') @@ -80,9 +75,7 @@ class CommandMSDel : public Command mi = &ci->memos; } else - { mi = &u->Account()->memos; - } if (numstr.empty() || (!isdigit(numstr[0]) && numstr != "ALL" && numstr != "LAST")) this->OnSyntaxError(u, numstr); else if (mi->memos.empty()) @@ -99,31 +92,23 @@ class CommandMSDel : public Command else if (numstr == "LAST") { /* Delete last memo. */ - for (i = 0; i < mi->memos.size(); ++i) + for (i = 0, end = mi->memos.size(); i < end; ++i) last = mi->memos[i]->number; if (ci) - { FOREACH_MOD(I_OnMemoDel, OnMemoDel(ci, mi, last)); - } else - { - FOREACH_MOD(I_OnMemoDel, OnMemoDel(u->Account(), mi, last)) - } + FOREACH_MOD(I_OnMemoDel, OnMemoDel(u->Account(), mi, last)); delmemo(mi, last); notice_lang(Config.s_MemoServ, u, MEMO_DELETED_ONE, last); } else { if (ci) - { FOREACH_MOD(I_OnMemoDel, OnMemoDel(ci, mi, 0)); - } else - { FOREACH_MOD(I_OnMemoDel, OnMemoDel(u->Account(), mi, 0)); - } /* Delete all memos. */ - for (i = 0; i < mi->memos.size(); ++i) + for (i = 0, end = mi->memos.size(); i < end; ++i) { delete [] mi->memos[i]->text; delete mi->memos[i]; @@ -136,7 +121,7 @@ class CommandMSDel : public Command } /* Reset the order */ - for (i = 0; i < mi->memos.size(); ++i) + for (i = 0, end = mi->memos.size(); i < end; ++i) mi->memos[i]->number = i + 1; } return MOD_CONT; @@ -167,6 +152,8 @@ class MSDel : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); + + this->AddCommand(MemoServ, new CommandMSDel()); } }; diff --git a/src/core/ms_help.cpp b/src/core/ms_help.cpp index 2aa837d64..9a982e7b5 100644 --- a/src/core/ms_help.cpp +++ b/src/core/ms_help.cpp @@ -7,9 +7,8 @@ * * Based on the original code of Epona by Lara. * Based on the original code of Services by Andy Church. - * - * */ + /*************************************************************************/ #include "module.h" @@ -31,7 +30,7 @@ class CommandMSHelp : public Command void OnSyntaxError(User *u, const ci::string &subcommand) { notice_help(Config.s_MemoServ, u, MEMO_HELP_HEADER); - for (CommandMap::const_iterator it = NickServ->Commands.begin(); it != NickServ->Commands.end(); ++it) + for (CommandMap::const_iterator it = MemoServ->Commands.begin(), it_end = MemoServ->Commands.end(); it != it_end; ++it) it->second->OnServHelp(u); notice_help(Config.s_MemoServ, u, MEMO_HELP_FOOTER, Config.s_ChanServ); } @@ -45,6 +44,7 @@ class MSHelp : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); + this->AddCommand(MemoServ, new CommandMSHelp()); } }; diff --git a/src/core/ms_info.cpp b/src/core/ms_info.cpp index 81650d584..89c814a6e 100644 --- a/src/core/ms_info.cpp +++ b/src/core/ms_info.cpp @@ -7,9 +7,8 @@ * * Based on the original code of Epona by Lara. * Based on the original code of Services by Andy Church. - * - * */ + /*************************************************************************/ #include "module.h" @@ -84,12 +83,10 @@ class CommandMSInfo : public Command } else { - int count = 0, i; - for (i = 0; i < mi->memos.size(); ++i) - { + int count = 0, i, end; + for (i = 0, end = mi->memos.size(); i < end; ++i) if (mi->memos[i]->HasFlag(MF_UNREAD)) ++count; - } if (count == mi->memos.size()) notice_lang(Config.s_MemoServ, u, MEMO_INFO_X_MEMOS_ALL_UNREAD, name, count); else if (!count) @@ -143,12 +140,10 @@ class CommandMSInfo : public Command } else { - int count = 0, i; - for (i = 0; i < mi->memos.size(); ++i) - { + int count = 0, i, end; + for (i = 0, end = mi->memos.size(); i < end; ++i) if (mi->memos[i]->HasFlag(MF_UNREAD)) ++count; - } if (count == mi->memos.size()) notice_lang(Config.s_MemoServ, u, MEMO_INFO_MEMOS_ALL_UNREAD, count); else if (!count) @@ -213,6 +208,7 @@ class MSInfo : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); + this->AddCommand(MemoServ, new CommandMSInfo()); } }; diff --git a/src/core/ms_list.cpp b/src/core/ms_list.cpp index 088fcdb12..f635db8c8 100644 --- a/src/core/ms_list.cpp +++ b/src/core/ms_list.cpp @@ -7,9 +7,8 @@ * * Based on the original code of Epona by Lara. * Based on the original code of Services by Andy Church. - * - * */ + /*************************************************************************/ #include "module.h" @@ -67,7 +66,7 @@ class CommandMSList : public Command ci::string param = params.size() ? params[0] : "", chan; ChannelInfo *ci; MemoInfo *mi; - int i; + int i, end; if (!param.empty() && param[0] == '#') { @@ -87,9 +86,7 @@ class CommandMSList : public Command mi = &ci->memos; } else - { mi = &u->Account()->memos; - } if (!param.empty() && !isdigit(param[0]) && param != "NEW") this->OnSyntaxError(u, param); else if (!mi->memos.size()) @@ -107,12 +104,10 @@ class CommandMSList : public Command { if (!param.empty()) { - for (i = 0; i < mi->memos.size(); ++i) - { + for (i = 0, end = mi->memos.size(); i < end; ++i) if (mi->memos[i]->HasFlag(MF_UNREAD)) break; - } - if (i == mi->memos.size()) + if (i == end) { if (!chan.empty()) notice_lang(Config.s_MemoServ, u, MEMO_X_HAS_NO_NEW_MEMOS, chan.c_str()); @@ -124,7 +119,7 @@ class CommandMSList : public Command bool SentHeader = false; - for (i = 0; i < mi->memos.size(); ++i) + for (i = 0, end = mi->memos.size(); i < end; ++i) { if (!param.empty() && !(mi->memos[i]->HasFlag(MF_UNREAD))) continue; @@ -171,6 +166,7 @@ class MSList : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); + this->AddCommand(MemoServ, new CommandMSList()); } }; diff --git a/src/core/ms_read.cpp b/src/core/ms_read.cpp index 9553127af..fb2de7c9e 100644 --- a/src/core/ms_read.cpp +++ b/src/core/ms_read.cpp @@ -7,9 +7,8 @@ * * Based on the original code of Epona by Lara. * Based on the original code of Services by Andy Church. - * - * */ + /*************************************************************************/ #include "module.h" @@ -83,9 +82,7 @@ class CommandMSRead : public Command mi = &ci->memos; } else - { mi = &u->Account()->memos; - } num = !numstr.empty() ? atoi(numstr.c_str()) : -1; if (numstr.empty() || (numstr != "LAST" && numstr != "NEW" && num <= 0)) this->OnSyntaxError(u, numstr); @@ -97,19 +94,17 @@ class CommandMSRead : public Command notice_lang(Config.s_MemoServ, u, MEMO_HAVE_NO_MEMOS); } else { - int i; + int i, end; if (numstr == "NEW") { int readcount = 0; - for (i = 0; i < mi->memos.size(); ++i) - { + for (i = 0, end = mi->memos.size(); i < end; ++i) if (mi->memos[i]->HasFlag(MF_UNREAD)) { MemoListCallback::DoRead(u, mi, ci, i); ++readcount; } - } if (!readcount) { if (!chan.empty()) @@ -120,13 +115,11 @@ class CommandMSRead : public Command } else if (numstr == "LAST") { - for (i = 0; i < mi->memos.size() - 1; ++i); + for (i = 0, end = mi->memos.size() - 1; i < end; ++i); MemoListCallback::DoRead(u, mi, ci, i); } else /* number[s] */ - { (new MemoListCallback(u, mi, numstr.c_str()))->Process(); - } } return MOD_CONT; } @@ -156,6 +149,7 @@ class MSRead : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); + this->AddCommand(MemoServ, new CommandMSRead()); } }; diff --git a/src/core/ms_rsend.cpp b/src/core/ms_rsend.cpp index 5ad43ac49..3776333f8 100644 --- a/src/core/ms_rsend.cpp +++ b/src/core/ms_rsend.cpp @@ -7,9 +7,8 @@ * * Based on the original code of Epona by Lara. * Based on the original code of Services by Andy Church. - * - * */ + /*************************************************************************/ #include "module.h" @@ -29,13 +28,10 @@ class CommandMSRSend : public Command int z = 3; /* prevent user from rsend to themselves */ - if ((na = findnick(nick))) + if ((na = findnick(nick)) && na->nc == u->Account()) { - if (na->nc == u->Account()) - { - notice_lang(Config.s_MemoServ, u, MEMO_NO_RSEND_SELF); - return MOD_CONT; - } + notice_lang(Config.s_MemoServ, u, MEMO_NO_RSEND_SELF); + return MOD_CONT; } if (Config.MSMemoReceipt == 1) @@ -81,13 +77,14 @@ class MSRSend : public Module public: MSRSend(const std::string &modname, const std::string &creator) : Module(modname, creator) { + if (!Config.MSMemoReceipt) + throw ModuleException("Don't like memo reciepts, or something."); + this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(MemoServ, new CommandMSRSend()); - if (!Config.MSMemoReceipt) - throw ModuleException("Don't like memo reciepts, or something."); + this->AddCommand(MemoServ, new CommandMSRSend()); } }; diff --git a/src/core/ms_send.cpp b/src/core/ms_send.cpp index 71479924c..1958cce79 100644 --- a/src/core/ms_send.cpp +++ b/src/core/ms_send.cpp @@ -7,9 +7,8 @@ * * Based on the original code of Epona by Lara. * Based on the original code of Services by Andy Church. - * - * */ + /*************************************************************************/ #include "module.h" @@ -55,6 +54,7 @@ class MSSend : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); + this->AddCommand(MemoServ, new CommandMSSend()); } }; diff --git a/src/core/ms_sendall.cpp b/src/core/ms_sendall.cpp index 9150152df..b8b0d2bf1 100644 --- a/src/core/ms_sendall.cpp +++ b/src/core/ms_sendall.cpp @@ -7,9 +7,8 @@ * * Based on the original code of Epona by Lara. * Based on the original code of Services by Andy Church. - * - * */ + /*************************************************************************/ #include "module.h" @@ -34,10 +33,10 @@ class CommandMSSendAll : public Command NickAlias *na = findnick(u->nick); - for (nickcore_map::const_iterator it = NickCoreList.begin(); it != NickCoreList.end(); ++it) + for (nickcore_map::const_iterator it = NickCoreList.begin(), it_end = NickCoreList.end(); it != it_end; ++it) { NickCore *nc = it->second; - + if ((na && na->nc == nc) || stricmp(u->nick.c_str(), nc->display)) memo_send(u, nc->display, text, z); } @@ -71,6 +70,7 @@ class MSSendAll : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); + this->AddCommand(MemoServ, new CommandMSSendAll()); } }; diff --git a/src/core/ms_set.cpp b/src/core/ms_set.cpp index d915d7856..dfb2d6f54 100644 --- a/src/core/ms_set.cpp +++ b/src/core/ms_set.cpp @@ -7,9 +7,8 @@ * * Based on the original code of Epona by Lara. * Based on the original code of Services by Andy Church. - * - * */ + /*************************************************************************/ #include "module.h" diff --git a/src/core/ms_staff.cpp b/src/core/ms_staff.cpp index 3d2877e44..66a24aa68 100644 --- a/src/core/ms_staff.cpp +++ b/src/core/ms_staff.cpp @@ -7,9 +7,8 @@ * * Based on the original code of Epona by Lara. * Based on the original code of Services by Andy Church. - * - * */ + /*************************************************************************/ #include "module.h" @@ -32,10 +31,10 @@ class CommandMSStaff : public Command return MOD_CONT; } - for (nickcore_map::const_iterator it = NickCoreList.begin(); it != NickCoreList.end(); ++it) + for (nickcore_map::const_iterator it = NickCoreList.begin(), it_end = NickCoreList.end(); it != it_end; ++it) { NickCore *nc = it->second; - + if (nc->IsServicesOper()) memo_send(u, nc->display, text, z); } @@ -68,6 +67,7 @@ class MSStaff : public Module this->SetAuthor("Anope"); this->SetVersion(VERSION_STRING); this->SetType(CORE); + this->AddCommand(MemoServ, new CommandMSStaff()); } }; diff --git a/src/core/ns_suspend.cpp b/src/core/ns_suspend.cpp index ef147551a..4359eedcf 100644 --- a/src/core/ns_suspend.cpp +++ b/src/core/ns_suspend.cpp @@ -84,7 +84,7 @@ class CommandNSSuspend : public Command Alog() << Config.s_NickServ << ": " << u->nick << " set SUSPEND for nick " << nick; notice_lang(Config.s_NickServ, u, NICK_SUSPEND_SUCCEEDED, nick); - FOREACH_MOD(I_OnNickSuspended, OnNickSuspend(na)) + FOREACH_MOD(I_OnNickSuspended, OnNickSuspend(na)); } else { |