diff options
-rw-r--r-- | data/example.conf | 13 | ||||
-rw-r--r-- | include/config.h | 2 | ||||
-rw-r--r-- | include/extern.h | 3 | ||||
-rw-r--r-- | include/language.h | 12 | ||||
-rw-r--r-- | include/services.h | 4 | ||||
-rw-r--r-- | modules/core/cs_akick.cpp | 91 | ||||
-rw-r--r-- | modules/core/cs_clear.cpp | 181 | ||||
-rw-r--r-- | modules/core/cs_clearusers.cpp | 87 | ||||
-rw-r--r-- | modules/core/cs_saset.cpp | 7 | ||||
-rw-r--r-- | modules/core/cs_set.cpp | 7 | ||||
-rw-r--r-- | modules/core/cs_set_mlock.cpp | 185 | ||||
-rw-r--r-- | modules/core/db_plain.cpp | 6 | ||||
-rw-r--r-- | modules/core/os_clearmodes.cpp | 189 | ||||
-rw-r--r-- | modules/extra/db_mysql.cpp | 7 | ||||
-rw-r--r-- | src/chanserv.cpp | 81 | ||||
-rw-r--r-- | src/config.cpp | 2 | ||||
-rw-r--r-- | src/language.cpp | 129 | ||||
-rw-r--r-- | src/modes.cpp | 4 |
18 files changed, 128 insertions, 882 deletions
diff --git a/data/example.conf b/data/example.conf index aa6964e16..1216e163b 100644 --- a/data/example.conf +++ b/data/example.conf @@ -641,7 +641,7 @@ log * chanserv/list chanserv/suspend chanserv/topic chanserv/status * * chanserv/saset/bantype chanserv/saset/description chanserv/saset/email chanserv/saset/entrymsg - * chanserv/saset/founder chanserv/saset/keeptopic chanserv/saset/mlock chanserv/saset/opnotice + * chanserv/saset/founder chanserv/saset/keeptopic chanserv/saset/opnotice * chanserv/saset/peace chanserv/saset/persist chanserv/saset/private chanserv/saset/restricted * chanserv/saset/secure chanserv/saset/securefounder chanserv/saset/secureops * chanserv/saset/signkick chanserv/saset/successor chanserv/saset/topiclock @@ -661,7 +661,7 @@ log * operserv/global operserv/news operserv/stats operserv/kick * operserv/mode operserv/session operserv/modlist operserv/ignore * operserv/chankill operserv/akill operserv/sqline operserv/snline - * operserv/szline operserv/clearmodes operserv/staff operserv/defcon + * operserv/szline operserv/staff operserv/defcon * operserv/modload operserv/jupe operserv/set operserv/noop * operserv/quit operserv/update operserv/reload operserv/restart * operserv/shutdown operserv/svsnick operserv/oline operserv/umode @@ -693,7 +693,7 @@ opertype inherits = "Helper, Another Helper" /* What commands (see above) this opertype may use */ - commands = "chanserv/list chanserv/suspend chanserv/status chanserv/topic memoserv/staff nickserv/sendpass nickserv/resetpass nickserv/suspend operserv/mode operserv/chankill operserv/szline operserv/akill operserv/session operserv/clearmodes operserv/modlist operserv/sqline operserv/staff operserv/kick operserv/ignore operserv/snline" + commands = "chanserv/list chanserv/suspend chanserv/status chanserv/topic memoserv/staff nickserv/sendpass nickserv/resetpass nickserv/suspend operserv/mode operserv/chankill operserv/szline operserv/akill operserv/session operserv/modlist operserv/sqline operserv/staff operserv/kick operserv/ignore operserv/snline" /* What privs (see above) this opertype has */ privs = "chanserv/auspex chanserv/no-register-limit memoserv/* nickserv/auxpex nickserv/confirm" @@ -1044,7 +1044,7 @@ chanserv * The core modules to load for ChanServ. This is a space separated list that corresponds * to the base names of the modules for ChanServ. This directive is optional, but highly recommended. */ - modules = "cs_help cs_register cs_set cs_saset cs_saset_noexpire cs_set_bantype cs_set_description cs_set_entrymsg cs_set_founder cs_set_keeptopic cs_set_mlock cs_set_opnotice cs_set_peace cs_set_persist cs_set_private cs_set_restricted cs_set_secure cs_set_securefounder cs_set_secureops cs_set_signkick cs_set_successor cs_set_topiclock cs_set_xop cs_xop cs_access cs_akick cs_drop cs_ban cs_clear cs_modes cs_getkey cs_invite cs_kick cs_list cs_topic cs_info cs_forbid cs_suspend cs_status cs_unban cs_clone" + modules = "cs_help cs_register cs_set cs_saset cs_saset_noexpire cs_set_bantype cs_set_description cs_set_entrymsg cs_set_founder cs_set_keeptopic cs_set_opnotice cs_set_peace cs_set_persist cs_set_private cs_set_restricted cs_set_secure cs_set_securefounder cs_set_secureops cs_set_signkick cs_set_successor cs_set_topiclock cs_set_xop cs_xop cs_access cs_akick cs_drop cs_ban cs_clearusers cs_modes cs_getkey cs_invite cs_kick cs_list cs_topic cs_info cs_forbid cs_suspend cs_status cs_unban cs_clone" /* * The default options for newly registered channels. Note that changing these options @@ -1340,7 +1340,7 @@ operserv * The core modules to load for OperServ. This is a space separated list that corresponds * to the base names of the modules for OperServ. This directive is optional, but highly recommended. */ - modules = "os_help os_global os_stats os_staff os_mode os_kick os_clearmodes os_akill os_snline os_sqline os_szline os_chanlist os_userlist os_news os_session os_noop os_jupe os_ignore os_set os_reload os_update os_restart os_quit os_shutdown os_defcon os_chankill os_svsnick os_oline os_umode os_modload os_modunload os_modreload os_modlist os_modinfo" + modules = "os_help os_global os_stats os_staff os_mode os_kick os_akill os_snline os_sqline os_szline os_chanlist os_userlist os_news os_session os_noop os_jupe os_ignore os_set os_reload os_update os_restart os_quit os_shutdown os_defcon os_chankill os_svsnick os_oline os_umode os_modload os_modunload os_modreload os_modlist os_modinfo" /* * If set, Services Admins will be able to use SUPERADMIN [ON|OFF] which will temporarily grant @@ -1388,7 +1388,6 @@ operserv * - bados: A non-IRCop attempts to use OperServ * - osglobal: OperServ's GLOBAL command was used * - osmode: OperServ's MODE command was used - * - osclearmodes: OperServ's CLEARMODES command was used * - oskick: OperServ's KICK command was used * - osakill: OperServ's AKILL command was used * - ossnline: OperServ's SNLINE command was used @@ -1410,7 +1409,7 @@ operserv * * This directive is optional, if left blank, there will be no notifications. */ - notifications="osglobal osmode osclearmodes oskick osakill ossnline ossqline osszline osnoop osjupe getpass setpass forbid drop" + notifications="osglobal osmode oskick osakill ossnline ossqline osszline osnoop osjupe getpass setpass forbid drop" /* * Enables session limiting. Session limiting prevents users from connecting more than a certain diff --git a/include/config.h b/include/config.h index ff6608b1e..0dfd70d9d 100644 --- a/include/config.h +++ b/include/config.h @@ -711,8 +711,6 @@ class CoreExport ServerConfig bool WallOSGlobal; /* Send a WALLOPS/GLOBOPS when someone uses the MODE command */ bool WallOSMode; - /* Send a WALLOPS/GLOBOPS when someone uses the CLEARMODES command */ - bool WallOSClearmodes; /* Send a WALLOPS/GLOBOPS when someone uses the KICK command */ bool WallOSKick; /* Send a WALLOPS/GLOBOPS when someone uses the AKILL command */ diff --git a/include/extern.h b/include/extern.h index a3e919e5b..b8bcb5be3 100644 --- a/include/extern.h +++ b/include/extern.h @@ -115,9 +115,6 @@ E bool IsFounder(User *user, ChannelInfo *ci); E int get_access(User *user, ChannelInfo *ci); E void update_cs_lastseen(User *user, ChannelInfo *ci); E int get_idealban(ChannelInfo *ci, User *u, Anope::string &ret); -E AutoKick *is_stuck(ChannelInfo *ci, const Anope::string &mask); -E void stick_mask(ChannelInfo *ci, AutoKick *akick); -E void stick_all(ChannelInfo *ci); E int levelinfo_maxwidth; E Anope::string get_mlock_modes(ChannelInfo *ci, int complete); diff --git a/include/language.h b/include/language.h index 5406e3480..0b1c60f2c 100644 --- a/include/language.h +++ b/include/language.h @@ -5,6 +5,7 @@ enum LanguageString COMMAND_IDENTIFY_REQUIRED, COMMAND_CANNOT_USE, COMMAND_CAN_USE, + COMMAND_DEPRECATED, USER_RECORD_NOT_FOUND, UNKNOWN_COMMAND, UNKNOWN_COMMAND_HELP, @@ -348,11 +349,7 @@ enum LanguageString CHAN_ENTRY_MSG_UNSET, CHAN_SET_BANTYPE_INVALID, CHAN_SET_BANTYPE_CHANGED, - CHAN_SET_MLOCK_UNKNOWN_CHAR, - CHAN_SET_MLOCK_IMPOSSIBLE_CHAR, - CHAN_SET_MLOCK_L_REQUIRED, - CHAN_SET_MLOCK_K_REQUIRED, - CHAN_MLOCK_CHANGED, + CHAN_SET_MLOCK_DEPRECATED, CHAN_SET_KEEPTOPIC_SYNTAX, CHAN_SET_KEEPTOPIC_ON, CHAN_SET_KEEPTOPIC_OFF, @@ -498,8 +495,6 @@ enum LanguageString CHAN_AKICK_ADDED, CHAN_AKICK_NOT_FOUND, CHAN_AKICK_NO_MATCH, - CHAN_AKICK_STUCK, - CHAN_AKICK_UNSTUCK, CHAN_AKICK_DELETED, CHAN_AKICK_DELETED_ONE, CHAN_AKICK_DELETED_SEVERAL, @@ -507,7 +502,6 @@ enum LanguageString CHAN_AKICK_LIST_HEADER, CHAN_AKICK_LIST_FORMAT, CHAN_AKICK_VIEW_FORMAT, - CHAN_AKICK_VIEW_FORMAT_STUCK, CHAN_AKICK_LAST_USED, CHAN_AKICK_ENFORCE_DONE, CHAN_AKICK_CLEAR, @@ -1304,7 +1298,6 @@ enum LanguageString CHAN_HELP_CMD_SET_DESC, CHAN_HELP_CMD_SET_ENTRYMSG, CHAN_HELP_CMD_SET_BANTYPE, - CHAN_HELP_CMD_SET_MLOCK, CHAN_HELP_CMD_SET_KEEPTOPIC, CHAN_HELP_CMD_SET_OPNOTICE, CHAN_HELP_CMD_SET_PEACE, @@ -1327,7 +1320,6 @@ enum LanguageString CHAN_HELP_SET_BANTYPE, CHAN_HELP_SET_KEEPTOPIC, CHAN_HELP_SET_TOPICLOCK, - CHAN_HELP_SET_MLOCK, CHAN_HELP_SET_PEACE, CHAN_HELP_SET_PRIVATE, CHAN_HELP_SET_RESTRICTED, diff --git a/include/services.h b/include/services.h index 182444238..38abf931f 100644 --- a/include/services.h +++ b/include/services.h @@ -586,9 +586,7 @@ struct ChanAccess enum AutoKickFlag { /* Is by nick core, not mask */ - AK_ISNICK, - /* This entry is stuck */ - AK_STUCK + AK_ISNICK }; /* AutoKick data. */ diff --git a/modules/core/cs_akick.cpp b/modules/core/cs_akick.cpp index 175b20047..f539952d7 100644 --- a/modules/core/cs_akick.cpp +++ b/modules/core/cs_akick.cpp @@ -117,7 +117,7 @@ class AkickViewCallback : public AkickListCallback else timebuf = GetString(u, UNKNOWN); - u->SendMessage(ChanServ, akick->HasFlag(AK_STUCK) ? CHAN_AKICK_VIEW_FORMAT_STUCK : CHAN_AKICK_VIEW_FORMAT, index + 1, akick->HasFlag(AK_ISNICK) ? akick->nc->display.c_str() : akick->mask.c_str(), !akick->creator.empty() ? akick->creator.c_str() : GetString(u, UNKNOWN).c_str(), timebuf.c_str(), !akick->reason.empty() ? akick->reason.c_str() : GetString(u, NO_REASON).c_str()); + u->SendMessage(ChanServ, CHAN_AKICK_VIEW_FORMAT, index + 1, akick->HasFlag(AK_ISNICK) ? akick->nc->display.c_str() : akick->mask.c_str(), !akick->creator.empty() ? akick->creator.c_str() : GetString(u, UNKNOWN).c_str(), timebuf.c_str(), !akick->reason.empty() ? akick->reason.c_str() : GetString(u, NO_REASON).c_str()); if (akick->last_used) u->SendMessage(ChanServ, CHAN_AKICK_LAST_USED, do_strftime(akick->last_used).c_str()); @@ -270,89 +270,6 @@ class CommandCSAKick : public Command this->DoEnforce(u, ci); } - void DoStick(User *u, ChannelInfo *ci, const std::vector<Anope::string> ¶ms) - { - NickAlias *na; - NickCore *nc; - Anope::string mask = params[2]; - unsigned i, end; - AutoKick *akick; - - if (!ci->GetAkickCount()) - { - u->SendMessage(ChanServ, CHAN_AKICK_LIST_EMPTY, ci->name.c_str()); - return; - } - - na = findnick(mask); - nc = na ? na->nc : NULL; - - for (i = 0, end = ci->GetAkickCount(); i < end; ++i) - { - akick = ci->GetAkick(i); - - if (akick->HasFlag(AK_ISNICK)) - continue; - if (mask.equals_ci(akick->mask)) - break; - } - - if (i == end) - { - u->SendMessage(ChanServ, CHAN_AKICK_NOT_FOUND, mask.c_str(), ci->name.c_str()); - return; - } - - bool override = !check_access(u, ci, CA_AKICK); - Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "STICK " << akick->mask; - - akick->SetFlag(AK_STUCK); - u->SendMessage(ChanServ, CHAN_AKICK_STUCK, akick->mask.c_str(), ci->name.c_str()); - - if (ci->c) - stick_mask(ci, akick); - } - - void DoUnStick(User *u, ChannelInfo *ci, const std::vector<Anope::string> ¶ms) - { - NickAlias *na; - NickCore *nc; - AutoKick *akick; - unsigned i, end; - Anope::string mask = params[2]; - - if (!ci->GetAkickCount()) - { - u->SendMessage(ChanServ, CHAN_AKICK_LIST_EMPTY, ci->name.c_str()); - return; - } - - na = findnick(mask); - nc = na ? na->nc : NULL; - - for (i = 0, end = ci->GetAkickCount(); i < end; ++i) - { - akick = ci->GetAkick(i); - - if (akick->HasFlag(AK_ISNICK)) - continue; - if (mask.equals_ci(akick->mask)) - break; - } - - if (i == end) - { - u->SendMessage(ChanServ, CHAN_AKICK_NOT_FOUND, mask.c_str(), ci->name.c_str()); - return; - } - - bool override = !check_access(u, ci, CA_AKICK); - Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "UNSTICK " << akick->mask; - - akick->UnsetFlag(AK_STUCK); - u->SendMessage(ChanServ, CHAN_AKICK_UNSTUCK, akick->mask.c_str(), ci->name.c_str()); - } - void DoDel(User *u, ChannelInfo *ci, const std::vector<Anope::string> ¶ms) { Anope::string mask = params[2]; @@ -542,7 +459,7 @@ class CommandCSAKick : public Command ChannelInfo *ci = cs_findchan(chan); - if (mask.empty() && (cmd.equals_ci("ADD") || cmd.equals_ci("STICK") || cmd.equals_ci("UNSTICK") || cmd.equals_ci("DEL"))) + if (mask.empty() && (cmd.equals_ci("ADD") || cmd.equals_ci("DEL"))) this->OnSyntaxError(u, cmd); else if (!check_access(u, ci, CA_AKICK) && !u->Account()->HasPriv("chanserv/access/modify")) u->SendMessage(ChanServ, ACCESS_DENIED); @@ -550,10 +467,6 @@ class CommandCSAKick : public Command u->SendMessage(ChanServ, CHAN_AKICK_DISABLED); else if (cmd.equals_ci("ADD")) this->DoAdd(u, ci, params); - else if (cmd.equals_ci("STICK")) - this->DoStick(u, ci, params); - else if (cmd.equals_ci("UNSTICK")) - this->DoUnStick(u, ci, params); else if (cmd.equals_ci("DEL")) this->DoDel(u, ci, params); else if (cmd.equals_ci("LIST")) diff --git a/modules/core/cs_clear.cpp b/modules/core/cs_clear.cpp deleted file mode 100644 index e9763dbdf..000000000 --- a/modules/core/cs_clear.cpp +++ /dev/null @@ -1,181 +0,0 @@ -/* ChanServ core functions - * - * (C) 2003-2010 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - * - * Based on the original code of Epona by Lara. - * Based on the original code of Services by Andy Church. - */ - -/*************************************************************************/ - -#include "module.h" - -class CommandCSClear : public Command -{ - public: - CommandCSClear() : Command("CLEAR", 2, 2) - { - } - - CommandReturn Execute(User *u, const std::vector<Anope::string> ¶ms) - { - Anope::string chan = params[0]; - Anope::string what = params[1]; - Channel *c = findchan(chan); - ChannelInfo *ci = c ? c->ci : NULL; - Anope::string modebuf; - - ChannelMode *owner = ModeManager::FindChannelModeByName(CMODE_OWNER); - ChannelMode *admin = ModeManager::FindChannelModeByName(CMODE_PROTECT); - ChannelMode *op = ModeManager::FindChannelModeByName(CMODE_OP); - ChannelMode *halfop = ModeManager::FindChannelModeByName(CMODE_HALFOP); - ChannelMode *voice = ModeManager::FindChannelModeByName(CMODE_VOICE); - - if (c) - // XXX - Log(LOG_COMMAND, u, this, ci) << what; - - if (!c) - u->SendMessage(ChanServ, CHAN_X_NOT_IN_USE, chan.c_str()); - else if (!check_access(u, ci, CA_CLEAR)) - u->SendMessage(ChanServ, ACCESS_DENIED); - else if (what.equals_ci("bans")) - { - c->ClearBans(); - - u->SendMessage(ChanServ, CHAN_CLEARED_BANS, chan.c_str()); - } - else if (ModeManager::FindChannelModeByName(CMODE_EXCEPT) && what.equals_ci("excepts")) - { - c->ClearExcepts(); - - u->SendMessage(ChanServ, CHAN_CLEARED_EXCEPTS, chan.c_str()); - } - else if (ModeManager::FindChannelModeByName(CMODE_INVITE) && what.equals_ci("invites")) - { - c->ClearInvites(); - - u->SendMessage(ChanServ, CHAN_CLEARED_INVITES, chan.c_str()); - } - else if (what.equals_ci("modes")) - { - c->ClearModes(); - check_modes(c); - - u->SendMessage(ChanServ, CHAN_CLEARED_MODES, chan.c_str()); - } - else if (what.equals_ci("ops")) - { - if (ircd->svsmode_ucmode) - { - if (owner) - { - modebuf = "-" + owner->ModeChar; - - ircdproto->SendSVSModeChan(c, modebuf, ""); - } - if (admin) - { - modebuf = "-" + admin->ModeChar; - - ircdproto->SendSVSModeChan(c, modebuf, ""); - } - if (op) - { - modebuf = "-" + op->ModeChar; - - ircdproto->SendSVSModeChan(c, modebuf, ""); - } - } - else - { - for (CUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end; ++it) - { - UserContainer *uc = *it; - - if (uc->Status->HasFlag(CMODE_OWNER)) - c->RemoveMode(NULL, owner, uc->user->nick); - if (uc->Status->HasFlag(CMODE_PROTECT)) - c->RemoveMode(NULL, admin, uc->user->nick); - if (uc->Status->HasFlag(CMODE_OP)) - c->RemoveMode(NULL, op, uc->user->nick); - } - } - - u->SendMessage(ChanServ, CHAN_CLEARED_OPS, chan.c_str()); - } - else if ((halfop && what.equals_ci("hops")) || (voice && what.equals_ci("voices"))) - { - ChannelMode *cm = what.equals_ci("hops") ? halfop : voice; - - if (ircd->svsmode_ucmode) - { - modebuf = "-" + cm->ModeChar; - - ircdproto->SendSVSModeChan(c, modebuf, ""); - } - else - { - for (CUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end; ++it) - { - UserContainer *uc = *it; - - if (uc->Status->HasFlag(cm->Name)) - c->RemoveMode(NULL, cm, uc->user->nick); - } - } - } - else if (what.equals_ci("users")) - { - Anope::string buf = "CLEAR USERS command from " + u->nick; - - for (CUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end; ) - { - UserContainer *uc = *it++; - - c->Kick(NULL, uc->user, "%s", buf.c_str()); - } - - u->SendMessage(ChanServ, CHAN_CLEARED_USERS, chan.c_str()); - } - else - SyntaxError(ChanServ, u, "CLEAR", CHAN_CLEAR_SYNTAX); - - return MOD_CONT; - } - - bool OnHelp(User *u, const Anope::string &subcommand) - { - u->SendMessage(ChanServ, CHAN_HELP_CLEAR); - return true; - } - - void OnSyntaxError(User *u, const Anope::string &subcommand) - { - SyntaxError(ChanServ, u, "CLEAR", CHAN_CLEAR_SYNTAX); - } - - void OnServHelp(User *u) - { - u->SendMessage(ChanServ, CHAN_HELP_CMD_CLEAR); - } -}; - -class CSClear : public Module -{ - CommandCSClear commandcsclear; - - public: - CSClear(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator) - { - this->SetAuthor("Anope"); - this->SetType(CORE); - - this->AddCommand(ChanServ, &commandcsclear); - } -}; - -MODULE_INIT(CSClear) diff --git a/modules/core/cs_clearusers.cpp b/modules/core/cs_clearusers.cpp new file mode 100644 index 000000000..55c6f684e --- /dev/null +++ b/modules/core/cs_clearusers.cpp @@ -0,0 +1,87 @@ +/* ChanServ core functions + * + * (C) 2003-2010 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + * Based on the original code of Epona by Lara. + * Based on the original code of Services by Andy Church. + */ + +/*************************************************************************/ + +#include "module.h" + +class CommandCSClearUsers : public Command +{ + public: + CommandCSClearUsers() : Command("CLEARUSERS", 1, 1) + { + } + + CommandReturn Execute(User *u, const std::vector<Anope::string> ¶ms) + { + Anope::string chan = params[0]; + Anope::string what = params[1]; + Channel *c = findchan(chan); + ChannelInfo *ci = c ? c->ci : NULL; + Anope::string modebuf; + + ChannelMode *owner = ModeManager::FindChannelModeByName(CMODE_OWNER); + ChannelMode *admin = ModeManager::FindChannelModeByName(CMODE_PROTECT); + ChannelMode *op = ModeManager::FindChannelModeByName(CMODE_OP); + ChannelMode *halfop = ModeManager::FindChannelModeByName(CMODE_HALFOP); + ChannelMode *voice = ModeManager::FindChannelModeByName(CMODE_VOICE); + + if (!c) + u->SendMessage(ChanServ, CHAN_X_NOT_IN_USE, chan.c_str()); + else if (!check_access(u, ci, CA_CLEAR)) + u->SendMessage(ChanServ, ACCESS_DENIED); + + Anope::string buf = "CLEAR USERS command from " + u->nick + " (" + u->Account()->display + ")"; + + for (CUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end; ) + { + UserContainer *uc = *it++; + + c->Kick(NULL, uc->user, "%s", buf.c_str()); + } + + u->SendMessage(ChanServ, CHAN_CLEARED_USERS, chan.c_str()); + + return MOD_CONT; + } + + bool OnHelp(User *u, const Anope::string &subcommand) + { + u->SendMessage(ChanServ, CHAN_HELP_CLEAR); + return true; + } + + void OnSyntaxError(User *u, const Anope::string &subcommand) + { + SyntaxError(ChanServ, u, "CLEAR", CHAN_CLEAR_SYNTAX); + } + + void OnServHelp(User *u) + { + u->SendMessage(ChanServ, CHAN_HELP_CMD_CLEAR); + } +}; + +class CSClearUsers : public Module +{ + CommandCSClearUsers commandcsclearusers; + + public: + CSClearUsers(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator) + { + this->SetAuthor("Anope"); + this->SetType(CORE); + + this->AddCommand(ChanServ, &commandcsclearusers); + } +}; + +MODULE_INIT(CSClearUsers) diff --git a/modules/core/cs_saset.cpp b/modules/core/cs_saset.cpp index 0e485e540..491e5725f 100644 --- a/modules/core/cs_saset.cpp +++ b/modules/core/cs_saset.cpp @@ -36,6 +36,13 @@ class CommandCSSASet : public Command return MOD_CONT; } + // XXX Remove after 1.9.4 release + if (params[1].equals_ci("MLOCK")) + { + u->SendMessage(ChanServ, CHAN_SET_MLOCK_DEPRECATED); + return MOD_CONT; + } + Command *c = this->FindCommand(params[1]); if (c) diff --git a/modules/core/cs_set.cpp b/modules/core/cs_set.cpp index fe37e7ea6..04721cab8 100644 --- a/modules/core/cs_set.cpp +++ b/modules/core/cs_set.cpp @@ -41,6 +41,13 @@ class CommandCSSet : public Command return MOD_CONT; } + // XXX Remove after 1.9.4 release + if (params[1].equals_ci("MLOCK")) + { + u->SendMessage(ChanServ, CHAN_SET_MLOCK_DEPRECATED); + return MOD_CONT; + } + Command *c = this->FindCommand(params[1]); if (c) diff --git a/modules/core/cs_set_mlock.cpp b/modules/core/cs_set_mlock.cpp deleted file mode 100644 index 2556653a2..000000000 --- a/modules/core/cs_set_mlock.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/* ChanServ core functions - * - * (C) 2003-2010 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - * - * Based on the original code of Epona by Lara. - * Based on the original code of Services by Andy Church. - */ - -/*************************************************************************/ - -#include "module.h" - -class CommandCSSetMLock : public Command -{ - public: - CommandCSSetMLock(const Anope::string &cpermission = "") : Command("MLOCK", 1, 0, cpermission) - { - } - - CommandReturn Execute(User *u, const std::vector<Anope::string> ¶ms) - { - ChannelInfo *ci = cs_findchan(params[0]); - if (!ci) - throw CoreException("NULL ci in CommandCSSetMLock"); - - int add = -1; /* 1 if adding, 0 if deleting, -1 if neither */ - ChannelMode *cm; - unsigned paramcount = 2; - - ci->ClearMLock(); - ci->ClearParams(); - - if (ModeManager::FindChannelModeByName(CMODE_REGISTERED)) - ci->SetMLock(CMODE_REGISTERED, true); - - Anope::string modes = params[1]; - for (Anope::string::const_iterator ch = modes.begin(), end = modes.end(); ch != end; ++ch) - { - switch (*ch) - { - case '+': - add = 1; - continue; - case '-': - add = 0; - continue; - default: - if (add < 0) - continue; - } - - if ((cm = ModeManager::FindChannelModeByChar(*ch))) - { - if (cm->Type == MODE_STATUS || cm->Type == MODE_LIST || !cm->CanSet(u)) - u->SendMessage(ChanServ, CHAN_SET_MLOCK_IMPOSSIBLE_CHAR, *ch); - else if (add) - { - ci->RemoveMLock(cm->Name); - - if (cm->Type == MODE_PARAM) - { - if (paramcount >= params.size()) - continue; - - Anope::string param = params[paramcount++]; - - ChannelModeParam *cmp = debug_cast<ChannelModeParam *>(cm); - - if (!cmp || !cmp->IsValid(param)) - continue; - - ci->SetMLock(cmp->Name, true, param); - } - else - ci->SetMLock(cm->Name, true); - } - else - ci->SetMLock(cm->Name, false); - } - else - u->SendMessage(ChanServ, CHAN_SET_MLOCK_UNKNOWN_CHAR, *ch); - } - - /* We can't mlock +L if +l is not mlocked as well. */ - if (ModeManager::FindChannelModeByName(CMODE_REDIRECT) && ci->HasMLock(CMODE_REDIRECT, true) && !ci->HasMLock(CMODE_LIMIT, true)) - { - ci->RemoveMLock(CMODE_REDIRECT); - u->SendMessage(ChanServ, CHAN_SET_MLOCK_L_REQUIRED); - } - - /* Some ircd we can't set NOKNOCK without INVITE */ - /* So check if we need there is a NOKNOCK MODE and that we need INVITEONLY */ - if (ModeManager::FindChannelModeByName(CMODE_NOKNOCK) && ircd->knock_needs_i && ci->HasMLock(CMODE_NOKNOCK, true) && !ci->HasMLock(CMODE_INVITE, true)) - { - ci->RemoveMLock(CMODE_NOKNOCK); - u->SendMessage(ChanServ, CHAN_SET_MLOCK_K_REQUIRED); - } - - /* Since we always enforce mode r there is no way to have no - * mode lock at all. - */ - if (!get_mlock_modes(ci, 0).empty()) - u->SendMessage(ChanServ, CHAN_MLOCK_CHANGED, ci->name.c_str(), get_mlock_modes(ci, 0).c_str()); - - /* Implement the new lock. */ - if (ci->c) - check_modes(ci->c); - - return MOD_CONT; - } - - bool OnHelp(User *u, const Anope::string &) - { - u->SendMessage(ChanServ, CHAN_HELP_SET_MLOCK, "SET"); - return true; - } - - void OnSyntaxError(User *u, const Anope::string &) - { - // XXX - SyntaxError(ChanServ, u, "SET", CHAN_SET_SYNTAX); - } - - void OnServHelp(User *u) - { - u->SendMessage(ChanServ, CHAN_HELP_CMD_SET_MLOCK); - } -}; - -class CommandCSSASetMLock : public CommandCSSetMLock -{ - public: - CommandCSSASetMLock() : CommandCSSetMLock("chanserv/saset/mlock") - { - } - - bool OnHelp(User *u, const Anope::string &) - { - u->SendMessage(ChanServ, CHAN_HELP_SET_MLOCK, "SASET"); - return true; - } - - void OnSyntaxError(User *u, const Anope::string &) - { - // XXX - SyntaxError(ChanServ, u, "SASET", CHAN_SASET_SYNTAX); - } -}; - -class CSSetMLock : public Module -{ - CommandCSSetMLock commandcssetmlock; - CommandCSSASetMLock commandcssasetmlock; - - public: - CSSetMLock(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator) - { - this->SetAuthor("Anope"); - this->SetType(CORE); - - Command *c = FindCommand(ChanServ, "SET"); - if (c) - c->AddSubcommand(&commandcssetmlock); - - c = FindCommand(ChanServ, "SASET"); - if (c) - c->AddSubcommand(&commandcssasetmlock); - } - - ~CSSetMLock() - { - Command *c = FindCommand(ChanServ, "SET"); - if (c) - c->DelSubcommand(&commandcssetmlock); - - c = FindCommand(ChanServ, "SASET"); - if (c) - c->DelSubcommand(&commandcssasetmlock); - } -}; - -MODULE_INIT(CSSetMLock) diff --git a/modules/core/db_plain.cpp b/modules/core/db_plain.cpp index 19acd810d..d6f7963d5 100644 --- a/modules/core/db_plain.cpp +++ b/modules/core/db_plain.cpp @@ -710,7 +710,7 @@ class DBPlain : public Module } else if (key.equals_ci("AKICK")) { - bool Stuck = params[0].equals_ci("STUCK"); + // 0 is the old stuck bool Nick = params[1].equals_ci("NICK"); NickCore *nc = NULL; if (Nick) @@ -728,8 +728,6 @@ class DBPlain : public Module ak = ci->AddAkick(params[3], nc, params.size() > 6 ? params[6] : "", params[4].is_pos_number_only() ? convertTo<time_t>(params[4]) : 0, params[5].is_pos_number_only() ? convertTo<time_t>(params[5]) : 0); else ak = ci->AddAkick(params[3], params[2], params.size() > 6 ? params[6] : "", params[4].is_pos_number_only() ? convertTo<time_t>(params[4]) : 0, params[5].is_pos_number_only() ? convertTo<time_t>(params[5]) : 0); - if (Stuck) - ak->SetFlag(AK_STUCK); if (Nick) ak->SetFlag(AK_ISNICK); @@ -968,7 +966,7 @@ class DBPlain : public Module db << "MD ACCESS " << ci->GetAccess(k)->nc->display << " " << ci->GetAccess(k)->level << " " << ci->GetAccess(k)->last_seen << " " << ci->GetAccess(k)->creator << endl; for (unsigned k = 0, end = ci->GetAkickCount(); k < end; ++k) { - db << "MD AKICK " << (ci->GetAkick(k)->HasFlag(AK_STUCK) ? "STUCK " : "UNSTUCK ") << (ci->GetAkick(k)->HasFlag(AK_ISNICK) ? "NICK " : "MASK ") << + db << "MD AKICK 0 " << (ci->GetAkick(k)->HasFlag(AK_ISNICK) ? "NICK " : "MASK ") << (ci->GetAkick(k)->HasFlag(AK_ISNICK) ? ci->GetAkick(k)->nc->display : ci->GetAkick(k)->mask) << " " << ci->GetAkick(k)->creator << " " << ci->GetAkick(k)->addtime << " " << ci->last_used << " :"; if (!ci->GetAkick(k)->reason.empty()) db << ci->GetAkick(k)->reason; diff --git a/modules/core/os_clearmodes.cpp b/modules/core/os_clearmodes.cpp deleted file mode 100644 index 0042ac58f..000000000 --- a/modules/core/os_clearmodes.cpp +++ /dev/null @@ -1,189 +0,0 @@ -/* OperServ core functions - * - * (C) 2003-2010 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - * - * Based on the original code of Epona by Lara. - * Based on the original code of Services by Andy Church. - */ - -/*************************************************************************/ - -#include "module.h" - -class CommandOSClearModes : public Command -{ - public: - CommandOSClearModes() : Command("CLEARMODES", 1, 2, "operserv/clearmodes") - { - } - - CommandReturn Execute(User *u, const std::vector<Anope::string> ¶ms) - { - Anope::string chan = params[0]; - Channel *c; - int all = 0; - ChannelMode *cm; - Anope::string buf; - - if (!(c = findchan(chan))) - { - u->SendMessage(OperServ, CHAN_X_NOT_IN_USE, chan.c_str()); - return MOD_CONT; - } - else if (c->bouncy_modes) - { - u->SendMessage(OperServ, OPER_BOUNCY_MODES_U_LINE); - return MOD_CONT; - } - else - { - Anope::string s = params.size() > 1 ? params[1] : ""; - if (!s.empty()) - { - if (s.equals_ci("ALL")) - all = 1; - else - { - this->OnSyntaxError(u, ""); - return MOD_CONT; - } - } - - if (Config->WallOSClearmodes) - ircdproto->SendGlobops(OperServ, "%s used CLEARMODES%s on %s", u->nick.c_str(), all ? " ALL" : "", chan.c_str()); - if (all) - { - /* Clear mode +o */ - if (ircd->svsmode_ucmode) - ircdproto->SendSVSModeChan(c, "-o", ""); - else - { - for (CUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end; ++it) - { - UserContainer *uc = *it; - - if (uc->Status->HasFlag(CMODE_OP)) - c->RemoveMode(NULL, CMODE_OP, uc->user->nick); - } - } - - /* Clear mode +v */ - if (ircd->svsmode_ucmode) - ircdproto->SendSVSModeChan(c, "-v", ""); - else - { - for (CUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end; ++it) - { - UserContainer *uc = *it; - - if (uc->Status->HasFlag(CMODE_VOICE)) - c->RemoveMode(NULL, CMODE_VOICE, uc->user->nick); - } - } - - /* Clear mode +h */ - if (ModeManager::FindChannelModeByName(CMODE_HALFOP)) - { - if (ircd->svsmode_ucmode) - ircdproto->SendSVSModeChan(c, "-h", ""); - else - { - for (CUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end; ++it) - { - UserContainer *uc = *it; - - if (uc->Status->HasFlag(CMODE_HALFOP)) - c->RemoveMode(NULL, CMODE_HALFOP, uc->user->nick); - } - } - } - - /* Clear mode Owners */ - if ((cm = ModeManager::FindChannelModeByName(CMODE_OWNER))) - { - buf = "-" + cm->ModeChar; - - if (ircd->svsmode_ucmode) - ircdproto->SendSVSModeChan(c, buf, ""); - else - { - for (CUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end; ++it) - { - UserContainer *uc = *it; - - if (uc->Status->HasFlag(CMODE_OWNER)) - c->RemoveMode(NULL, CMODE_OWNER, uc->user->nick); - } - } - } - - /* Clear mode protected or admins */ - if ((cm = ModeManager::FindChannelModeByName(CMODE_PROTECT))) - { - buf = "-" + cm->ModeChar; - - if (ircd->svsmode_ucmode) - ircdproto->SendSVSModeChan(c, buf, ""); - else - { - for (CUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end; ++it) - { - UserContainer *uc = *it; - - if (uc->Status->HasFlag(CMODE_PROTECT)) - c->RemoveMode(NULL, CMODE_PROTECT, uc->user->nick); - } - } - } - } - - - c->ClearModes(); - c->ClearBans(); - c->ClearExcepts(); - c->ClearInvites(); - } - - if (all) - u->SendMessage(OperServ, OPER_CLEARMODES_ALL_DONE, chan.c_str()); - else - u->SendMessage(OperServ, OPER_CLEARMODES_DONE, chan.c_str()); - - return MOD_CONT; - } - - bool OnHelp(User *u, const Anope::string &subcommand) - { - u->SendMessage(OperServ, OPER_HELP_CLEARMODES); - return true; - } - - void OnSyntaxError(User *u, const Anope::string &subcommand) - { - SyntaxError(OperServ, u, "CLEARMODES", OPER_CLEARMODES_SYNTAX); - } - - void OnServHelp(User *u) - { - u->SendMessage(OperServ, OPER_HELP_CMD_CLEARMODES); - } -}; - -class OSClearModes : public Module -{ - CommandOSClearModes commandosclearmodes; - - public: - OSClearModes(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator) - { - this->SetAuthor("Anope"); - this->SetType(CORE); - - this->AddCommand(OperServ, &commandosclearmodes); - } -}; - -MODULE_INIT(OSClearModes) diff --git a/modules/extra/db_mysql.cpp b/modules/extra/db_mysql.cpp index 6f18077f8..147a35229 100644 --- a/modules/extra/db_mysql.cpp +++ b/modules/extra/db_mysql.cpp @@ -752,21 +752,16 @@ class DBMySQL : public Module NickCore *nc = NULL; spacesepstream sep(r.Get(i, "flags")); Anope::string flag, mask; - bool stuck = false; while (sep.GetToken(flag)) { if (flag.equals_cs("ISNICK")) nc = findcore(r.Get(i, "mask")); - else if (flag.equals_cs("STUCK")) - stuck = true; AutoKick *ak; if (nc) ak = ci->AddAkick(r.Get(i, "creator"), nc, r.Get(i, "reason"), atol(r.Get(i, "created").c_str()), atol(r.Get(i, "last_used").c_str())); else ak = ci->AddAkick(r.Get(i, "creator"), r.Get(i, "mask"), r.Get(i, "reason"), atol(r.Get(i, "created").c_str()), atol(r.Get(i, "last_used").c_str())); - if (stuck) - ak->SetFlag(AK_STUCK); if (nc) ak->SetFlag(AK_ISNICK); } @@ -1268,7 +1263,7 @@ class DBMySQL : public Module void OnAkickAdd(ChannelInfo *ci, AutoKick *ak) { this->RunQuery("INSERT INTO `anope_cs_akick` (channel, flags, mask, reason, creator, created, last_used) VALUES('" + this->Escape(ci->name) + "', '" + - (ak->HasFlag(AK_ISNICK) ? "ISNICK " : "") + (ak->HasFlag(AK_STUCK) ? "STUCK " : "") + "', '" + + (ak->HasFlag(AK_ISNICK) ? "ISNICK" : "") + "', '" + this->Escape(ak->HasFlag(AK_ISNICK) ? ak->nc->display : ak->mask) + "', '" + this->Escape(ak->reason) + "', '" + this->Escape(ak->creator) + "', " + stringify(ak->addtime) + ", " + stringify(ak->last_used) + ")"); } diff --git a/src/chanserv.cpp b/src/chanserv.cpp index 282d05a20..ca37f0cc7 100644 --- a/src/chanserv.cpp +++ b/src/chanserv.cpp @@ -325,8 +325,6 @@ void check_modes(Channel *c) c->RemoveMode(NULL, cm); } } - - stick_all(ci); } /*************************************************************************/ @@ -752,85 +750,6 @@ Anope::string get_xop_level(int level) return "Founder"; } -/*************************************************************************/ -/*********************** ChanServ command routines ***********************/ -/*************************************************************************/ - -/* Is the mask stuck? */ - -AutoKick *is_stuck(ChannelInfo *ci, const Anope::string &mask) -{ - if (!ci) - return NULL; - - for (unsigned i = 0, akicks = ci->GetAkickCount(); i < akicks; ++i) - { - AutoKick *akick = ci->GetAkick(i); - - if (akick->HasFlag(AK_ISNICK) || !akick->HasFlag(AK_STUCK)) - continue; - - if (Anope::Match(akick->mask, mask)) - return akick; - - if (ircd->reversekickcheck) - if (Anope::Match(mask, akick->mask)) - return akick; - } - - return NULL; -} - -/* Ban the stuck mask in a safe manner. */ - -void stick_mask(ChannelInfo *ci, AutoKick *akick) -{ - Entry *ban; - - if (!ci) - return; - - if (ci->c->bans && ci->c->bans->entries) - { - for (ban = ci->c->bans->entries; ban; ban = ban->next) - { - /* If akick is already covered by a wider ban. - Example: c->bans[i] = *!*@*.org and akick->u.mask = *!*@*.epona.org */ - if (entry_match_mask(ban, akick->mask, 0)) - return; - - if (ircd->reversekickcheck) - { - /* If akick is wider than a ban already in place. - Example: c->bans[i] = *!*@irc.epona.org and akick->u.mask = *!*@*.epona.org */ - if (Anope::Match(ban->mask, akick->mask)) - return; - } - } - } - - /* Falling there means set the ban */ - ci->c->SetMode(NULL, CMODE_BAN, akick->mask); -} - -/* Ban the stuck mask in a safe manner. */ - -void stick_all(ChannelInfo *ci) -{ - if (!ci) - return; - - for (unsigned i = 0, akicks = ci->GetAkickCount(); i < akicks; ++i) - { - AutoKick *akick = ci->GetAkick(i); - - if (akick->HasFlag(AK_ISNICK) || !akick->HasFlag(AK_STUCK)) - continue; - - ci->c->SetMode(NULL, CMODE_BAN, akick->mask); - } -} - ChanServTimer::ChanServTimer(Channel *chan) : Timer(Config->CSInhabit), c(chan) { if (!ChanServ) diff --git a/src/config.cpp b/src/config.cpp index 61dfe7bc0..818021efb 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -184,8 +184,6 @@ ServerConfig::ServerConfig() : errstr(""), config_data() this->WallOSGlobal = true; else if (notice.equals_ci("osmode")) this->WallOSMode = true; - else if (notice.equals_ci("osclearmodes")) - this->WallOSClearmodes = true; else if (notice.equals_ci("oskick")) this->WallOSKick = true; else if (notice.equals_ci("osakill")) diff --git a/src/language.cpp b/src/language.cpp index badc76ec2..3ef010034 100644 --- a/src/language.cpp +++ b/src/language.cpp @@ -717,8 +717,8 @@ const char *const language_strings[LANG_STRING_COUNT] = { _("Allowed to use AKICK command"), /* CHAN_LEVEL_SET */ _("Allowed to use SET command (not FOUNDER/PASSWORD)"), - /* CHAN_LEVEL_CLEAR */ - _("Allowed to use CLEAR command"), + /* CHAN_LEVEL_CLEARUSERS */ + _("Allowed to use CLEARUSERS command"), /* CHAN_LEVEL_UNBAN */ _("Allowed to use UNBAN command"), /* CHAN_LEVEL_OPDEOP */ @@ -867,16 +867,8 @@ const char *const language_strings[LANG_STRING_COUNT] = { _("%s is not a valid ban type."), /* CHAN_SET_BANTYPE_CHANGED */ _("Ban type for channel %s is now #%d."), - /* CHAN_SET_MLOCK_UNKNOWN_CHAR */ - _("Unknown mode character %c ignored."), - /* CHAN_SET_MLOCK_IMPOSSIBLE_CHAR */ - _("Mode %c ignored because you can't lock it."), - /* CHAN_SET_MLOCK_L_REQUIRED */ - _("You must lock mode +l as well to lock mode +L."), - /* CHAN_SET_MLOCK_K_REQUIRED */ - _("You must lock mode +i as well to lock mode +K."), - /* CHAN_MLOCK_CHANGED */ - _("Mode lock on channel %s changed to %s."), + /* CHAN_SET_MLOCK_DEPRECATED */ + _("MLOCK is deprecated. Use \002%R%s HELP MODE\002 instead."), /* CHAN_SET_KEEPTOPIC_SYNTAX */ _("SET channel KEEPTOPIC {ON | OFF}"), /* CHAN_SET_KEEPTOPIC_ON */ @@ -1168,7 +1160,7 @@ const char *const language_strings[LANG_STRING_COUNT] = { _(" %3d %4d %s\n" " by %s, last seen %s"), /* CHAN_AKICK_SYNTAX */ - _("AKICK channel {ADD | STICK | UNSTICK | DEL | LIST | VIEW | ENFORCE | CLEAR} [nick-or-usermask] [reason]"), + _("AKICK channel {ADD | DEL | LIST | VIEW | ENFORCE | CLEAR} [nick-or-usermask] [reason]"), /* CHAN_AKICK_DISABLED */ _("Sorry, channel autokick list modification is temporarily disabled."), /* CHAN_AKICK_ALREADY_EXISTS */ @@ -1181,10 +1173,6 @@ const char *const language_strings[LANG_STRING_COUNT] = { _("%s not found on %s autokick list."), /* CHAN_AKICK_NO_MATCH */ _("No matching entries on %s autokick list."), - /* CHAN_AKICK_STUCK */ - _("%s is now always active on channel %s."), - /* CHAN_AKICK_UNSTUCK */ - _("%s is not always active anymore on channel %s."), /* CHAN_AKICK_DELETED */ _("%s deleted from %s autokick list."), /* CHAN_AKICK_DELETED_ONE */ @@ -1200,9 +1188,6 @@ const char *const language_strings[LANG_STRING_COUNT] = { /* CHAN_AKICK_VIEW_FORMAT */ _("%3d %s (by %s on %s)\n" " %s"), - /* CHAN_AKICK_VIEW_FORMAT_STUCK */ - _("%3d %s (stuck) (by %s on %s)\n" - " %s"), /* CHAN_AKICK_LAST_USED */ _(" Last used %s"), /* CHAN_AKICK_ENFORCE_DONE */ @@ -1309,20 +1294,8 @@ const char *const language_strings[LANG_STRING_COUNT] = { _("%s has been unbanned from %s."), /* CHAN_TOPIC_SYNTAX */ _("TOPIC channel [topic]"), - /* CHAN_CLEAR_SYNTAX */ - _("CLEAR channel what"), - /* CHAN_CLEARED_BANS */ - _("All bans on channel %s have been removed."), - /* CHAN_CLEARED_EXCEPTS */ - _("All excepts on channel %s have been removed."), - /* CHAN_CLEARED_MODES */ - _("All modes on channel %s have been reset."), - /* CHAN_CLEARED_OPS */ - _("Mode +o has been cleared from channel %s."), - /* CHAN_CLEARED_USERS */ - _("All users have been kicked from channel %s."), - /* CHAN_CLEARED_INVITES */ - _("All invites on channel %s have been removed."), + /* CHAN_CLEARUSERS */ + _("CLEARUSERS \037channel\037"), /* CHAN_CLONED */ _("All settings from \002%s\002 have been transferred to \002%s\002"), /* CHAN_CLONED_ACCESS */ @@ -2092,12 +2065,6 @@ const char *const language_strings[LANG_STRING_COUNT] = { _("Operflags %s have been added for %s."), /* OPER_OLINE_IRCOP */ _("You are now an IRC Operator."), - /* OPER_CLEARMODES_SYNTAX */ - _("CLEARMODES channel [ALL]"), - /* OPER_CLEARMODES_DONE */ - _("Binary modes and bans cleared from channel %s."), - /* OPER_CLEARMODES_ALL_DONE */ - _("All modes cleared from channel %s."), /* OPER_KICK_SYNTAX */ _("KICK channel user reason"), /* OPER_SVSNICK_SYNTAX */ @@ -3329,8 +3296,8 @@ const char *const language_strings[LANG_STRING_COUNT] = { _(" DROP Cancel the registration of a channel"), /* CHAN_HELP_CMD_BAN */ _(" BAN Bans a selected nick on a channel"), - /* CHAN_HELP_CMD_CLEAR */ - _(" CLEAR Tells ChanServ to clear certain settings on a channel"), + /* CHAN_HELP_CMD_CLEARUSERS */ + _(" CLEARUSERS Tells ChanServ to clear (kick) all users on a channel"), /* CHAN_HELP_CMD_DEVOICE */ _(" DEVOICE Devoices a selected nick on a channel"), /* CHAN_HELP_CMD_GETKEY */ @@ -3434,8 +3401,6 @@ const char *const language_strings[LANG_STRING_COUNT] = { " enter the channel"), /* CHAN_HELP_CMD_SET_BANTYPE */ _(" BANTYPE Set how Services make bans on the channel"), - /* CHAN_HELP_CMD_SET_MLOCK */ - _(" MLOCK Lock channel modes on or off"), /* CHAN_HELP_CMD_SET_KEEPTOPIC */ _(" KEEPTOPIC Retain topic when channel is not in use"), /* CHAN_HELP_CMD_SET_OPNOTICE */ @@ -3521,39 +3486,6 @@ const char *const language_strings[LANG_STRING_COUNT] = { "When topic lock is set, %S will not allow the\n" "channel topic to be changed except via the TOPIC\n" "command."), - /* CHAN_HELP_SET_MLOCK */ - _("Syntax: %s channel MLOCK modes\n" - " \n" - "Sets the mode-lock parameter for the channel. %S\n" - "allows you to define certain channel modes to be always\n" - "on, off or free to be either on or off.\n" - " \n" - "The modes parameter is constructed exactly the same way \n" - "as a /MODE command; that is, modes followed by a + are \n" - "locked on, and modes followed by a - are locked off. Note,\n" - "however, that unlike the /MODE command, each use of\n" - "SET MLOCK will remove all modes previously locked before\n" - "setting the new!\n" - " \n" - "Warning: If you set a mode-locked key, as in the second\n" - "example below, you should also set the RESTRICTED option for\n" - "the channel (see HELP SET RESTRICTED), or anyone entering\n" - "the channel when it is empty will be able to see the key!\n" - " \n" - "Examples:\n" - " \n" - " SET #channel MLOCK +nt-iklps\n" - " Forces modes n and t on, and modes i, k, l, p, and\n" - " s off. Mode m is left free to be either on or off.\n" - " \n" - " SET #channel MLOCK +knst-ilmp my-key\n" - " Forces modes k, n, s, and t on, and modes i, l, m,\n" - " and p off. Also forces the channel key to be\n" - " \"my-key\".\n" - " \n" - " SET #channel MLOCK +\n" - " Removes the mode lock; all channel modes are free\n" - " to be either on or off."), /* CHAN_HELP_SET_PEACE */ _("Syntax: %s channel PEACE {ON | OFF}\n" " \n" @@ -3908,8 +3840,6 @@ const char *const language_strings[LANG_STRING_COUNT] = { "information."), /* CHAN_HELP_AKICK */ _("Syntax: AKICK channel ADD {nick | mask} [reason]\n" - " AKICK channel STICK mask\n" - " AKICK channel UNSTICK mask\n" " AKICK channel DEL {nick | mask | entry-num | list}\n" " AKICK channel LIST [mask | entry-num | list]\n" " AKICK channel VIEW [mask | entry-num | list]\n" @@ -3930,15 +3860,6 @@ const char *const language_strings[LANG_STRING_COUNT] = { "will be added to the akick list instead of the mask.\n" "All users within that nickgroup will then be akicked.\n" " \n" - "The AKICK STICK command permanently bans the given mask \n" - "on the channel. If someone tries to remove the ban, %S\n" - "will automatically set it again. You can't use it for\n" - "registered nicks.\n" - " \n" - "The AKICK UNSTICK command cancels the effect of the\n" - "AKICK STICK command, so you'll be able to unset the\n" - "ban again on the channel.\n" - " \n" "The AKICK DEL command removes the given nick or mask\n" "from the AutoKick list. It does not, however, remove any\n" "bans placed by an AutoKick; those must be removed\n" @@ -4123,26 +4044,10 @@ const char *const language_strings[LANG_STRING_COUNT] = { " \n" "By default, limited to those with founder access on the\n" "channel."), - /* CHAN_HELP_CLEAR */ - _("Syntax: CLEAR channel what\n" - " \n" - "Tells %S to clear certain settings on a channel. what\n" - "can be any of the following:\n" - " \n" - " MODES Resets all modes on the channel (i.e. clears\n" - " modes i,k,l,m,n,p,s,t).\n" - " BANS Clears all bans on the channel.\n" - " EXCEPTS Clears all excepts on the channel.\n" - " INVITES Clears all invites on the channel.\n" - " OPS Removes channel-operator status (mode +o) from\n" - " all channel operators. If supported, removes\n" - " channel-admin (mode +a) and channel-owner (mode +q)\n" - " as well.\n" - " HOPS Removes channel-halfoperator status (mode +h) from\n" - " all channel halfoperators, if supported.\n" - " VOICES Removes \"voice\" status (mode +v) from anyone\n" - " with that mode set.\n" - " USERS Removes (kicks) all users from the channel.\n" + /* CHAN_HELP_CLEARUSERS */ + _("Syntax: CLEARUSERS channel\n" + " \n" + "Tells %S to clear (kick) all users certain settings on a channel." " \n" "By default, limited to those with founder access on the\n" "channel."), @@ -4398,8 +4303,6 @@ const char *const language_strings[LANG_STRING_COUNT] = { _(" MODE Change a channel's modes"), /* OPER_HELP_CMD_KICK */ _(" KICK Kick a user from a channel"), - /* OPER_HELP_CMD_CLEARMODES */ - _(" CLEARMODES Clear modes of a channel"), /* OPER_HELP_CMD_AKILL */ _(" AKILL Manipulate the AKILL list"), /* OPER_HELP_CMD_SNLINE */ @@ -4528,12 +4431,6 @@ const char *const language_strings[LANG_STRING_COUNT] = { "Allows Services Opers to give Operflags to any user.\n" "Flags have to be prefixed with a \"+\" or a \"-\". To\n" "remove all flags simply type a \"-\" instead of any flags."), - /* OPER_HELP_CLEARMODES */ - _("Syntax: CLEARMODES channel [ALL]\n" - " \n" - "Clears all binary modes (i,k,l,m,n,p,s,t) and bans from a\n" - "channel. If ALL is given, also clears all ops and\n" - "voices (+o and +v modes) from the channel."), /* OPER_HELP_KICK */ _("Syntax: KICK channel user reason\n" " \n" diff --git a/src/modes.cpp b/src/modes.cpp index 4795e55fc..6c6d43ad9 100644 --- a/src/modes.cpp +++ b/src/modes.cpp @@ -350,10 +350,6 @@ void ChannelModeBan::DelMask(Channel *chan, const Anope::string &mask) Log(LOG_DEBUG) << "Deleted ban " << mask << " from channel " << chan->name; } - - AutoKick *akick; - if (chan->ci && (akick = is_stuck(chan->ci, mask))) - stick_mask(chan->ci, akick); } /** Add an except to the channel |