From 37bd2c238eed91444a6812c6592c4e4ced3773a9 Mon Sep 17 00:00:00 2001 From: miwob Date: Thu, 19 Jun 2014 16:27:05 +0200 Subject: hybrid.cpp: add our own SendInvite() which sends the channel's timestamp along the INVITE command. INVITE with channel TS will be mandatory in some future release of ircd-hybrid --- modules/protocol/hybrid.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules') diff --git a/modules/protocol/hybrid.cpp b/modules/protocol/hybrid.cpp index 7c2c14098..52c442dc3 100644 --- a/modules/protocol/hybrid.cpp +++ b/modules/protocol/hybrid.cpp @@ -51,6 +51,11 @@ class HybridProto : public IRCDProto MaxModes = 4; } + void SendInvite(const MessageSource &source, const Channel *c, User *u) anope_override + { + UplinkSocket::Message(source) << "INVITE " << u->GetUID() << " " << c->name << " " << c->creation_time; + } + void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override { UplinkSocket::Message(bi) << "NOTICE $$" << dest->GetName() << " :" << msg; -- cgit From 8fecad3039626feb3200a133355b754b7751a35b Mon Sep 17 00:00:00 2001 From: Zantox Date: Mon, 23 Jun 2014 07:47:26 -0400 Subject: Updated BotServ Command English Language --- modules/commands/bs_assign.cpp | 8 ++++---- modules/commands/bs_badwords.cpp | 4 ++-- modules/commands/bs_bot.cpp | 8 ++++---- modules/commands/bs_control.cpp | 6 +++--- modules/commands/bs_set.cpp | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) (limited to 'modules') diff --git a/modules/commands/bs_assign.cpp b/modules/commands/bs_assign.cpp index 82572d0eb..99eff4b2f 100644 --- a/modules/commands/bs_assign.cpp +++ b/modules/commands/bs_assign.cpp @@ -75,7 +75,7 @@ class CommandBSAssign : public Command { this->SendSyntax(source); source.Reply(" "); - source.Reply(_("Assigns a bot pointed out by nick to a channel. You\n" + source.Reply(_("Assigns the specified bot to a channel. You\n" "can then configure the bot for the channel so it fits\n" "your needs.")); return true; @@ -121,7 +121,7 @@ class CommandBSUnassign : public Command if (ci->HasExt("PERSIST") && !ModeManager::FindChannelModeByName("PERM")) { - source.Reply(_("You can not unassign bots while persist is set on the channel.")); + source.Reply(_("You cannot unassign bots while persist is set on the channel.")); return; } @@ -195,9 +195,9 @@ class CommandBSSetNoBot : public Command { this->SendSyntax(source); source.Reply(_(" \n" - "This option makes a channel be unassignable. If a bot\n" + "This option makes a channel unassignable. If a bot\n" "is already assigned to the channel, it is unassigned\n" - "automatically when you enable the option.")); + "automatically when you enable it.")); return true; } }; diff --git a/modules/commands/bs_badwords.cpp b/modules/commands/bs_badwords.cpp index c4155bbc1..6deaa8924 100644 --- a/modules/commands/bs_badwords.cpp +++ b/modules/commands/bs_badwords.cpp @@ -400,7 +400,7 @@ class CommandBSBadwords : public Command if (Anope::ReadOnly) { - source.Reply(_("Sorry, channel bad words list modification is temporarily disabled.")); + source.Reply(_("Sorry, bad words list modification is temporarily disabled.")); return; } @@ -446,7 +446,7 @@ class CommandBSBadwords : public Command " Lists bad words entries numbered 2 through 5 and\n" " 7 through 9.\n" " \n" - "The \002CLEAR\002 command clears all entries of the\n" + "The \002CLEAR\002 command clears all entries from the\n" "bad words list.")); return true; } diff --git a/modules/commands/bs_bot.cpp b/modules/commands/bs_bot.cpp index 69fa7f8fe..d066a49a8 100644 --- a/modules/commands/bs_bot.cpp +++ b/modules/commands/bs_bot.cpp @@ -139,7 +139,7 @@ class CommandBSBot : public Command */ if (nick.equals_cs(bi->nick) && (!user.empty() ? user.equals_cs(bi->GetIdent()) : 1) && (!host.empty() ? host.equals_cs(bi->host) : 1) && (!real.empty() ? real.equals_cs(bi->realname) : 1)) { - source.Reply(_("Old info is equal to the new one.")); + source.Reply(_("The old information is the same as the new information specified.")); return; } @@ -341,13 +341,13 @@ class CommandBSBot : public Command "hostname and realname. Since no integrity checks are done\n" "for these settings, be really careful.\n" " \n" - "\002BOT CHANGE\002 allows to change the nickname, username, hostname\n" - "or realname of a bot without actually having to delete it (and\n" + "\002BOT CHANGE\002 allows you to change the nickname, username, hostname\n" + "or realname of a bot without deleting it (and\n" "all the data associated with it).\n" " \n" "\002BOT DEL\002 removes the given bot from the bot list.\n" " \n" - "\002Note\002: you cannot create a bot that has a nick that is\n" + "\002Note\002: You cannot create a bot with a nick that is\n" "currently registered. If an unregistered user is currently\n" "using the nick, they will be killed.")); return true; diff --git a/modules/commands/bs_control.cpp b/modules/commands/bs_control.cpp index 0307c6abf..5111a9551 100644 --- a/modules/commands/bs_control.cpp +++ b/modules/commands/bs_control.cpp @@ -16,7 +16,7 @@ class CommandBSSay : public Command public: CommandBSSay(Module *creator) : Command(creator, "botserv/say", 2, 2) { - this->SetDesc(_("Makes the bot say the given text on the given channel")); + this->SetDesc(_("Makes the bot say the specified text on the specified channel")); this->SetSyntax(_("\037channel\037 \037text\037")); } @@ -66,7 +66,7 @@ class CommandBSSay : public Command { this->SendSyntax(source); source.Reply(" "); - source.Reply(_("Makes the bot say the given text on the given channel.")); + source.Reply(_("Makes the bot say the specified text on the specified channel.")); return true; } }; @@ -125,7 +125,7 @@ class CommandBSAct : public Command this->SendSyntax(source); source.Reply(" "); source.Reply(_("Makes the bot do the equivalent of a \"/me\" command\n" - "on the given channel using the given text.")); + "on the specified channel using the specified text.")); return true; } }; diff --git a/modules/commands/bs_set.cpp b/modules/commands/bs_set.cpp index 2d08d9ec6..819ac42b3 100644 --- a/modules/commands/bs_set.cpp +++ b/modules/commands/bs_set.cpp @@ -100,7 +100,7 @@ class CommandBSSetBanExpire : public Command if (Anope::ReadOnly) { - source.Reply(_("Sorry, bot option setting is temporarily disabled.")); + source.Reply(_("Sorry, changing bot options is temporarily disabled.")); return; } -- cgit From 3bea089793ff80b756a63e7cca05947787dd0881 Mon Sep 17 00:00:00 2001 From: Zantox Date: Wed, 25 Jun 2014 02:09:43 -0400 Subject: Updated ChanServ Command English Language --- modules/commands/cs_drop.cpp | 4 ++-- modules/commands/cs_entrymsg.cpp | 12 ++++++------ modules/commands/cs_flags.cpp | 10 +++++----- modules/commands/cs_info.cpp | 4 ++-- modules/commands/cs_invite.cpp | 2 +- modules/commands/cs_kick.cpp | 2 +- modules/commands/cs_seen.cpp | 2 +- modules/commands/cs_unban.cpp | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) (limited to 'modules') diff --git a/modules/commands/cs_drop.cpp b/modules/commands/cs_drop.cpp index 401573ea2..93ce548cc 100644 --- a/modules/commands/cs_drop.cpp +++ b/modules/commands/cs_drop.cpp @@ -71,8 +71,8 @@ class CommandCSDrop : public Command this->SendSyntax(source); source.Reply(" "); if (source.IsServicesOper()) - source.Reply(_("Unregisters the named channel. Only \002Services Operators\002\n" - "can drop a channel of which they are not the founder.")); + source.Reply(_("Unregisters the specified channel. Only \002Services Operators\002\n" + "can drop a channel of which they are not the founder of.")); else source.Reply(_("Unregisters the named channel. Can only be used by\n" "the \002channel founder\002.")); diff --git a/modules/commands/cs_entrymsg.cpp b/modules/commands/cs_entrymsg.cpp index 4eec3e07d..da14456a5 100644 --- a/modules/commands/cs_entrymsg.cpp +++ b/modules/commands/cs_entrymsg.cpp @@ -239,19 +239,19 @@ class CommandEntryMessage : public Command source.Reply(_("Controls what messages will be sent to users when they join the channel.")); source.Reply(" "); source.Reply(_("The \002ENTRYMSG ADD\002 command adds the given message to\n" - "the list of messages to be shown to users when they join\n" + "the list of messages shown to users when they join\n" "the channel.")); source.Reply(" "); - source.Reply(_("The \002ENTRYMSG DEL\002 command removes the given message from\n" - "the list of messages to be shown to users when they join\n" - "the channel. You can remove the message by specifying its number\n" + source.Reply(_("The \002ENTRYMSG DEL\002 command removes the specified message from\n" + "the list of messages shown to users when they join\n" + "the channel. You can a message by specifying its number\n" "which you can get by listing the messages as explained below.")); source.Reply(" "); source.Reply(_("The \002ENTRYMSG LIST\002 command displays a listing of messages\n" - "to be shown to users when they join the channel.")); + "shown to users when they join the channel.")); source.Reply(" "); source.Reply(_("The \002ENTRYMSG CLEAR\002 command clears all entries from\n" - "the list of messages to be shown to users when they join\n" + "the list of messages shown to users when they join\n" "the channel, effectively disabling entry messages.")); return true; } diff --git a/modules/commands/cs_flags.cpp b/modules/commands/cs_flags.cpp index e3f3da978..e3613377f 100644 --- a/modules/commands/cs_flags.cpp +++ b/modules/commands/cs_flags.cpp @@ -227,7 +227,7 @@ class CommandCSFlags : public Command override = true; else { - source.Reply(_("You can not set the \002%c\002 flag."), f); + source.Reply(_("You cannot set the \002%c\002 flag."), f); break; } } @@ -417,19 +417,19 @@ class CommandCSFlags : public Command source.Reply(_("%s is another way to modify the channel access list, similar to\n" "the XOP and ACCESS methods."), source.command.c_str()); source.Reply(" "); - source.Reply(_("The \002MODIFY\002 command allows you to modify the access list. If mask is\n" - "not already on the access list is it added, then the changes are applied.\n" + source.Reply(_("The \002MODIFY\002 command allows you to modify the access list. If the mask is\n" + "not already on the access list it is added, then the changes are applied.\n" "If the mask has no more flags, then the mask is removed from the access list.\n" "Additionally, you may use +* or -* to add or remove all flags, respectively. You are\n" "only able to modify the access list if you have the proper permission on the channel,\n" - "and even then you can only give other people access to up what you already have.")); + "and even then you can only give other people access to the equivalent of what your access is.")); source.Reply(" "); source.Reply(_("The \002LIST\002 command allows you to list existing entries on the channel access list.\n" "If a mask is given, the mask is wildcard matched against all existing entries on the\n" "access list, and only those entries are returned. If a set of flags is given, only those\n" "on the access list with the specified flags are returned.")); source.Reply(" "); - source.Reply(_("The \002CLEAR\002 command clears the channel access list, which requires channel founder.")); + source.Reply(_("The \002CLEAR\002 command clears the channel access list. This requires channel founder access.")); source.Reply(" "); source.Reply(_("The available flags are:")); diff --git a/modules/commands/cs_info.cpp b/modules/commands/cs_info.cpp index af12aba78..c92f6415d 100644 --- a/modules/commands/cs_info.cpp +++ b/modules/commands/cs_info.cpp @@ -16,7 +16,7 @@ class CommandCSInfo : public Command public: CommandCSInfo(Module *creator) : Command(creator, "chanserv/info", 1, 2) { - this->SetDesc(_("Lists information about the named registered channel")); + this->SetDesc(_("Lists information about the specified registered channel")); this->SetSyntax(_("\037channel\037")); this->AllowUnregistered(true); } @@ -73,7 +73,7 @@ class CommandCSInfo : public Command { this->SendSyntax(source); source.Reply(" "); - source.Reply(_("Lists information about the named registered channel,\n" + source.Reply(_("Lists information about the specified registered channel,\n" "including its founder, time of registration, and last\n" "time used. If the user issuing the command has the\n" "appropriate access for it, then the description, successor,\n" diff --git a/modules/commands/cs_invite.cpp b/modules/commands/cs_invite.cpp index 1f39eaf7b..e264a54f1 100644 --- a/modules/commands/cs_invite.cpp +++ b/modules/commands/cs_invite.cpp @@ -91,7 +91,7 @@ class CommandCSInvite : public Command source.Reply(_("Tells %s to invite you or an optionally specified\n" "nick into the given channel.\n" " \n" - "By default, limited to AOPs or those with level 5 and above\n" + "By default, limited to AOPs or those with level 5 access and above\n" "on the channel."), source.service->nick.c_str()); return true; } diff --git a/modules/commands/cs_kick.cpp b/modules/commands/cs_kick.cpp index dded149eb..c95445557 100644 --- a/modules/commands/cs_kick.cpp +++ b/modules/commands/cs_kick.cpp @@ -115,7 +115,7 @@ class CommandCSKick : public Command source.Reply(_("Kicks a specified nick from a channel.\n" " \n" "By default, limited to AOPs or those with level 5 access\n" - "and above on the channel. Channel founders may use masks too.")); + "and above on the channel. Channel founders can also specify masks.")); return true; } }; diff --git a/modules/commands/cs_seen.cpp b/modules/commands/cs_seen.cpp index 923edb361..7cbc23f43 100644 --- a/modules/commands/cs_seen.cpp +++ b/modules/commands/cs_seen.cpp @@ -172,7 +172,7 @@ class CommandOSSeen : public Command source.Reply(" "); source.Reply(_("The \002STATS\002 command prints out statistics about stored nicks and memory usage.")); source.Reply(_("The \002CLEAR\002 command lets you clean the database by removing all entries from the\n" - "entries from the database that were added within \037time\037.\n" + "database that were added within \037time\037.\n" " \n" "Example:\n" " %s CLEAR 30m\n" diff --git a/modules/commands/cs_unban.cpp b/modules/commands/cs_unban.cpp index 9fd6400a8..de727f8e7 100644 --- a/modules/commands/cs_unban.cpp +++ b/modules/commands/cs_unban.cpp @@ -106,7 +106,7 @@ class CommandCSUnban : public Command "in are removed.\n" " \n" "By default, limited to AOPs or those with level 5 and above\n" - "on the channel."), source.service->nick.c_str()); + "access on the channel."), source.service->nick.c_str()); return true; } }; -- cgit From 74dbfe06998a21c2375d064e9a56a1ec06b824e5 Mon Sep 17 00:00:00 2001 From: Zantox Date: Wed, 25 Jun 2014 02:16:09 -0400 Subject: Updated HostServ Command English Language --- modules/commands/hs_del.cpp | 2 +- modules/commands/hs_list.cpp | 2 +- modules/commands/hs_request.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/commands/hs_del.cpp b/modules/commands/hs_del.cpp index 76951de46..c27dc89d0 100644 --- a/modules/commands/hs_del.cpp +++ b/modules/commands/hs_del.cpp @@ -56,7 +56,7 @@ class CommandHSDelAll : public Command public: CommandHSDelAll(Module *creator) : Command(creator, "hostserv/delall", 1, 1) { - this->SetDesc(_("Delete the vhost for all nicks in a group")); + this->SetDesc(_("Deletes the vhost for all nicks in a group")); this->SetSyntax(_("\037nick\037")); } diff --git a/modules/commands/hs_list.cpp b/modules/commands/hs_list.cpp index e372860e2..dfeb23bd2 100644 --- a/modules/commands/hs_list.cpp +++ b/modules/commands/hs_list.cpp @@ -134,7 +134,7 @@ class CommandHSList : public Command this->SendSyntax(source); source.Reply(" "); source.Reply(_("This command lists registered vhosts to the operator\n" - "if a \037key\037 is specified, only entries whos nick or vhost match\n" + "If a \037key\037 is specified, only entries whose nick or vhost match\n" "the pattern given in \037key\037 are displayed e.g. Rob* for all\n" "entries beginning with \"Rob\"\n" "If a \037#X-Y\037 style is used, only entries between the range of \002X\002\n" diff --git a/modules/commands/hs_request.cpp b/modules/commands/hs_request.cpp index cd1a85c0a..498b51afb 100644 --- a/modules/commands/hs_request.cpp +++ b/modules/commands/hs_request.cpp @@ -171,7 +171,7 @@ class CommandHSRequest : public Command { this->SendSyntax(source); source.Reply(" "); - source.Reply(_("Request the given vHost to be actived for your nick by the\n" + source.Reply(_("Request the given vHost to be activated for your nick by the\n" "network administrators. Please be patient while your request\n" "is being considered.")); return true; -- cgit From f753a925ade9f3b3053b206e5cf5462d2be53b64 Mon Sep 17 00:00:00 2001 From: Zantox Date: Thu, 26 Jun 2014 15:10:01 -0400 Subject: Minor cs_unban Lang Update @Robby- --- modules/commands/cs_unban.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/commands/cs_unban.cpp b/modules/commands/cs_unban.cpp index de727f8e7..bbc08d3ac 100644 --- a/modules/commands/cs_unban.cpp +++ b/modules/commands/cs_unban.cpp @@ -105,8 +105,8 @@ class CommandCSUnban : public Command "given, all bans affecting you in channels you have access\n" "in are removed.\n" " \n" - "By default, limited to AOPs or those with level 5 and above\n" - "access on the channel."), source.service->nick.c_str()); + "By default, limited to AOPs or those with level 5 access and above\n" + "on the channel."), source.service->nick.c_str()); return true; } }; -- cgit From 7a64d95f7c796d91dbe1250dc1d88ecf8c113610 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 11 Jul 2014 00:22:32 -0400 Subject: Fix Log() calls in m_ldap_oper --- modules/extra/m_ldap_oper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/extra/m_ldap_oper.cpp b/modules/extra/m_ldap_oper.cpp index 3e16d75e6..05579da0b 100644 --- a/modules/extra/m_ldap_oper.cpp +++ b/modules/extra/m_ldap_oper.cpp @@ -50,7 +50,7 @@ class IdentifyInterface : public LDAPInterface o = new Oper(u->nick, ot); my_opers.insert(o); nc->o = o; - Log(this->owner) << "m_ldap_oper: Tied " << u->nick << " (" << nc->display << ") to opertype " << ot->GetName(); + Log(this->owner) << "Tied " << u->nick << " (" << nc->display << ") to opertype " << ot->GetName(); } } catch (const LDAPException &ex) @@ -64,7 +64,7 @@ class IdentifyInterface : public LDAPInterface } nc->o = NULL; - Log() << "Removed services operator from " << u->nick << " (" << nc->display << ")"; + Log(this->owner) << "Removed services operator from " << u->nick << " (" << nc->display << ")"; } } } -- cgit From 60229b15d2637369977596f742b234b52a6f6f1a Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 26 Jul 2014 13:24:52 -0400 Subject: When object unserialization fails (due to not having dependency objects) bump the ts to try again later. --- modules/database/db_sql_live.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/database/db_sql_live.cpp b/modules/database/db_sql_live.cpp index b9b8ef57c..fda68524d 100644 --- a/modules/database/db_sql_live.cpp +++ b/modules/database/db_sql_live.cpp @@ -166,7 +166,7 @@ class DBMySQL : public Module, public Pipe if (!this->CheckInit() || obj->GetTimestamp() == Anope::CurTime) return; - Query query("SELECT * FROM `" + this->prefix + obj->GetName() + "` WHERE (`timestamp` > " + this->SQL->FromUnixtime(obj->GetTimestamp()) + " OR `timestamp` IS NULL)"); + Query query("SELECT * FROM `" + this->prefix + obj->GetName() + "` WHERE (`timestamp` >= " + this->SQL->FromUnixtime(obj->GetTimestamp()) + " OR `timestamp` IS NULL)"); obj->UpdateTimestamp(); @@ -228,7 +228,10 @@ class DBMySQL : public Module, public Pipe } else { - delete s; + if (!s) + this->RunQuery("UPDATE `" + prefix + obj->GetName() + "` SET `timestamp` = " + this->SQL->FromUnixtime(obj->GetTimestamp()) + " WHERE `id` = " + stringify(id)); + else + delete s; } } } -- cgit From 17ba13bc957ebdda962944dcf6031355448f366d Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 26 Jul 2014 13:28:08 -0400 Subject: Use ts version of services stamp when the account is unconfirmed on Unreal as 3.2.10.4 has changed thie behavior --- modules/protocol/unreal.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/protocol/unreal.cpp b/modules/protocol/unreal.cpp index 4aa340f08..6f744f22f 100644 --- a/modules/protocol/unreal.cpp +++ b/modules/protocol/unreal.cpp @@ -345,7 +345,8 @@ class UnrealIRCdProto : public IRCDProto void SendLogin(User *u, NickAlias *na) anope_override { - if (Servers::Capab.count("ESVID") > 0) + /* 3.2.10.4+ treats users logged in with accounts as fully registered, even if -r, so we can not set this here. Just use the timestamp. */ + if (Servers::Capab.count("ESVID") > 0 && !na->nc->HasExt("UNCONFIRMED")) IRCD->SendMode(Config->GetClient("NickServ"), u, "+d %s", na->nc->display.c_str()); else IRCD->SendMode(Config->GetClient("NickServ"), u, "+d %d", u->signon); -- cgit From 1137c500958368f0ce0817d1354ddb71a9ac96f9 Mon Sep 17 00:00:00 2001 From: Robby- Date: Sun, 27 Jul 2014 07:34:02 +0200 Subject: Fix a few help messages. --- modules/commands/cs_entrymsg.cpp | 2 +- modules/commands/cs_info.cpp | 4 ++-- modules/commands/hs_list.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/commands/cs_entrymsg.cpp b/modules/commands/cs_entrymsg.cpp index da14456a5..6df6918da 100644 --- a/modules/commands/cs_entrymsg.cpp +++ b/modules/commands/cs_entrymsg.cpp @@ -244,7 +244,7 @@ class CommandEntryMessage : public Command source.Reply(" "); source.Reply(_("The \002ENTRYMSG DEL\002 command removes the specified message from\n" "the list of messages shown to users when they join\n" - "the channel. You can a message by specifying its number\n" + "the channel. You can remove a message by specifying its number\n" "which you can get by listing the messages as explained below.")); source.Reply(" "); source.Reply(_("The \002ENTRYMSG LIST\002 command displays a listing of messages\n" diff --git a/modules/commands/cs_info.cpp b/modules/commands/cs_info.cpp index f7ef0e72e..6405958b3 100644 --- a/modules/commands/cs_info.cpp +++ b/modules/commands/cs_info.cpp @@ -76,8 +76,8 @@ class CommandCSInfo : public Command source.Reply(_("Lists information about the specified registered channel,\n" "including its founder, time of registration, last\n" "time used, and description. If the user issuing the\n" - "command has the appropriate access for it, then the" - "successor, last topic set, settings and expiration" + "command has the appropriate access for it, then the\n" + "successor, last topic set, settings and expiration\n" "time will also be displayed when applicable.")); return true; } diff --git a/modules/commands/hs_list.cpp b/modules/commands/hs_list.cpp index dfeb23bd2..cbdbb25ae 100644 --- a/modules/commands/hs_list.cpp +++ b/modules/commands/hs_list.cpp @@ -133,7 +133,7 @@ class CommandHSList : public Command { this->SendSyntax(source); source.Reply(" "); - source.Reply(_("This command lists registered vhosts to the operator\n" + source.Reply(_("This command lists registered vhosts to the operator.\n" "If a \037key\037 is specified, only entries whose nick or vhost match\n" "the pattern given in \037key\037 are displayed e.g. Rob* for all\n" "entries beginning with \"Rob\"\n" -- cgit From 6842ad36f7367412859232ad226071ae860d3d87 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 3 Aug 2014 18:05:41 -0400 Subject: Do not allow unconfirmed users to send memos or request vhosts --- modules/commands/hs_request.cpp | 6 ++++++ modules/commands/ms_send.cpp | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'modules') diff --git a/modules/commands/hs_request.cpp b/modules/commands/hs_request.cpp index 498b51afb..616b2e772 100644 --- a/modules/commands/hs_request.cpp +++ b/modules/commands/hs_request.cpp @@ -96,6 +96,12 @@ class CommandHSRequest : public Command return; } + if (source.GetAccount()->HasExt("UNCONFIRMED")) + { + source.Reply(_("You must confirm your account before you may request a vhost.")); + return; + } + Anope::string rawhostmask = params[0]; Anope::string user, host; diff --git a/modules/commands/ms_send.cpp b/modules/commands/ms_send.cpp index eb3c98eca..f8f857607 100644 --- a/modules/commands/ms_send.cpp +++ b/modules/commands/ms_send.cpp @@ -39,6 +39,12 @@ class CommandMSSend : public Command return; } + if (source.GetAccount()->HasExt("UNCONFIRMED")) + { + source.Reply(_("You must confirm your account before you may send a memo.")); + return; + } + MemoServService::MemoResult result = memoserv->Send(source.GetNick(), nick, text); if (result == MemoServService::MEMO_SUCCESS) source.Reply(_("Memo sent to \002%s\002."), nick.c_str()); -- cgit From cf89e10a4c5d968ca46ca462cf643cfe8c246be0 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 3 Aug 2014 18:22:03 -0400 Subject: Add ms_ignore:max config option --- modules/commands/ms_ignore.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'modules') diff --git a/modules/commands/ms_ignore.cpp b/modules/commands/ms_ignore.cpp index 4483f9684..5db7117bf 100644 --- a/modules/commands/ms_ignore.cpp +++ b/modules/commands/ms_ignore.cpp @@ -50,6 +50,12 @@ class CommandMSIgnore : public Command source.Reply(ACCESS_DENIED); else if (command.equals_ci("ADD") && !param.empty()) { + if (mi->ignores.size() >= Config->GetModule(this->owner)->Get("max", "32")) + { + source.Reply(_("Sorry, the memo ignore list for \002%s\002 is full."), channel.c_str()); + return; + } + if (std::find(mi->ignores.begin(), mi->ignores.end(), param.ci_str()) == mi->ignores.end()) { mi->ignores.push_back(param.ci_str()); -- cgit From 830e8617e6e6465446829f6c230cba18ee8f9646 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 3 Aug 2014 18:28:54 -0400 Subject: Allow "set" in topic set to be optional --- modules/commands/cs_topic.cpp | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'modules') diff --git a/modules/commands/cs_topic.cpp b/modules/commands/cs_topic.cpp index bc5b9c000..1506bcc9c 100644 --- a/modules/commands/cs_topic.cpp +++ b/modules/commands/cs_topic.cpp @@ -114,10 +114,8 @@ class CommandCSTopic : public Command source.Reply(_("Topic lock option for %s is now \002off\002."), ci->name.c_str()); } - void Set(CommandSource &source, ChannelInfo *ci, const std::vector ¶ms) + void Set(CommandSource &source, ChannelInfo *ci, const Anope::string &topic) { - const Anope::string &topic = params.size() > 2 ? params[2] : ""; - bool has_topiclock = topiclock->HasExt(ci); topiclock->Unset(ci); ci->c->ChangeTopic(source.GetNick(), topic, Anope::CurTime); @@ -141,12 +139,7 @@ class CommandCSTopic : public Command else new_topic = topic; - std::vector new_params; - new_params.push_back("SET"); - new_params.push_back(ci->name); - new_params.push_back(new_topic); - - this->Set(source, ci, new_params); + this->Set(source, ci, new_topic); } public: @@ -154,7 +147,7 @@ class CommandCSTopic : public Command topiclock("TOPICLOCK") { this->SetDesc(_("Manipulate the topic of the specified channel")); - this->SetSyntax(_("\037channel\037 SET [\037topic\037]")); + this->SetSyntax(_("\037channel\037 [SET] [\037topic\037]")); this->SetSyntax(_("\037channel\037 APPEND \037topic\037")); this->SetSyntax(_("\037channel\037 [UNLOCK|LOCK]")); } @@ -174,12 +167,23 @@ class CommandCSTopic : public Command this->Unlock(source, ci, params); else if (!ci->c) source.Reply(CHAN_X_NOT_IN_USE, ci->name.c_str()); - else if (subcmd.equals_ci("SET")) - this->Set(source, ci, params); else if (subcmd.equals_ci("APPEND") && params.size() > 2) this->Append(source, ci, params); else - this->SendSyntax(source); + { + Anope::string topic; + if (subcmd.equals_ci("SET")) + { + topic = params.size() > 2 ? params[2] : ""; + } + else + { + topic = subcmd; + if (params.size() > 2) + topic += " " + params[2]; + } + this->Set(source, ci, topic); + } } bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override -- cgit From 063d9bf5f689fd9dc24394c267dfdce7b6a345e6 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 3 Aug 2014 18:33:56 -0400 Subject: Allow "modify" in flags to be optional --- modules/commands/cs_flags.cpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'modules') diff --git a/modules/commands/cs_flags.cpp b/modules/commands/cs_flags.cpp index e3613377f..5f9e070fc 100644 --- a/modules/commands/cs_flags.cpp +++ b/modules/commands/cs_flags.cpp @@ -78,11 +78,8 @@ FlagsAccessProvider* FlagsAccessProvider::ap; class CommandCSFlags : public Command { - void DoModify(CommandSource &source, ChannelInfo *ci, const std::vector ¶ms) + void DoModify(CommandSource &source, ChannelInfo *ci, Anope::string mask, const Anope::string &flags) { - Anope::string mask = params.size() > 2 ? params[2] : ""; - Anope::string flags = params.size() > 3 ? params[3] : ""; - if (flags.empty()) { this->OnSyntaxError(source, ""); @@ -370,7 +367,7 @@ class CommandCSFlags : public Command CommandCSFlags(Module *creator) : Command(creator, "chanserv/flags", 1, 4) { this->SetDesc(_("Modify the list of privileged users")); - this->SetSyntax(_("\037channel\037 MODIFY \037mask\037 \037changes\037")); + this->SetSyntax(_("\037channel\037 [MODIFY] \037mask\037 \037changes\037")); this->SetSyntax(_("\037channel\037 LIST [\037mask\037 | +\037flags\037]")); this->SetSyntax(_("\037channel\037 CLEAR")); } @@ -400,14 +397,26 @@ class CommandCSFlags : public Command source.Reply(ACCESS_DENIED); else if (Anope::ReadOnly && !is_list) source.Reply(_("Sorry, channel access list modification is temporarily disabled.")); - else if (cmd.equals_ci("MODIFY")) - this->DoModify(source, ci, params); else if (is_list) this->DoList(source, ci, params); else if (cmd.equals_ci("CLEAR")) this->DoClear(source, ci); else - this->OnSyntaxError(source, cmd); + { + Anope::string mask, flags; + if (cmd.equals_ci("MODIFY")) + { + mask = params.size() > 2 ? params[2] : ""; + flags = params.size() > 3 ? params[3] : ""; + } + else + { + mask = cmd; + flags = params.size() > 2 ? params[2] : ""; + } + + this->DoModify(source, ci, mask, flags); + } } bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override -- cgit From d6d72cd803b2c5bf38e152dc6d00dd6dda720951 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 3 Aug 2014 18:57:00 -0400 Subject: Add cs_mode:max config option --- modules/commands/cs_mode.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'modules') diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp index 2943c64a3..7f22d1e26 100644 --- a/modules/commands/cs_mode.cpp +++ b/modules/commands/cs_mode.cpp @@ -327,6 +327,8 @@ class CommandCSMode : public Command source.Reply(_("Missing parameter for mode %c."), cm->mchar); else if (cm->type == MODE_LIST && ci->c && IRCD->GetMaxListFor(ci->c) && ci->c->HasMode(cm->name) >= IRCD->GetMaxListFor(ci->c)) source.Reply(_("List for mode %c is full."), cm->mchar); + else if (modelocks->GetMLock().size() >= Config->GetModule(this->owner)->Get("max", "32")) + source.Reply(_("The mode lock list of \002%s\002 is full."), ci->name.c_str()); else { modelocks->SetMLock(cm, adding, mode_param, source.GetNick()); -- cgit From 8210e82a5ea02232e649a3f1c5f27214c655c5b6 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 3 Aug 2014 19:08:12 -0400 Subject: Fix some botserv help entries from showing when they shouldn't --- modules/commands/bs_set.cpp | 9 +++++++++ modules/commands/cs_set.cpp | 10 +++++----- modules/commands/ns_set.cpp | 10 +++++----- 3 files changed, 19 insertions(+), 10 deletions(-) (limited to 'modules') diff --git a/modules/commands/bs_set.cpp b/modules/commands/bs_set.cpp index 819ac42b3..cbe6adbe0 100644 --- a/modules/commands/bs_set.cpp +++ b/modules/commands/bs_set.cpp @@ -32,6 +32,8 @@ class CommandBSSet : public Command source.Reply(_("Configures bot options.\n" " \n" "Available options:")); + bool hide_privileged_commands = Config->GetBlock("options")->Get("hideprivilegedcommands"), + hide_registered_commands = Config->GetBlock("options")->Get("hideregisteredcommands"); Anope::string this_name = source.command; for (CommandInfo::map::const_iterator it = source.service->commands.begin(), it_end = source.service->commands.end(); it != it_end; ++it) { @@ -42,6 +44,13 @@ class CommandBSSet : public Command ServiceReference command("Command", info.name); if (command) { + // XXX dup + if (hide_registered_commands && !command->AllowUnregistered() && !source.GetAccount()) + continue; + + if (hide_privileged_commands && !info.permission.empty() && !source.HasCommand(info.permission)) + continue; + source.command = it->first; command->OnServHelp(source); } diff --git a/modules/commands/cs_set.cpp b/modules/commands/cs_set.cpp index 1109c888e..77e1d1fd5 100644 --- a/modules/commands/cs_set.cpp +++ b/modules/commands/cs_set.cpp @@ -35,7 +35,8 @@ class CommandCSSet : public Command " \n" "Available options:")); Anope::string this_name = source.command; - bool hide_privileged_commands = Config->GetBlock("options")->Get("hideprivilegedcommands"); + bool hide_privileged_commands = Config->GetBlock("options")->Get("hideprivilegedcommands"), + hide_registered_commands = Config->GetBlock("options")->Get("hideregisteredcommands"); for (CommandInfo::map::const_iterator it = source.service->commands.begin(), it_end = source.service->commands.end(); it != it_end; ++it) { const Anope::string &c_name = it->first; @@ -44,13 +45,12 @@ class CommandCSSet : public Command { ServiceReference c("Command", info.name); + // XXX dup if (!c) continue; - else if (!hide_privileged_commands) - ; // Always show with hide_privileged_commands disabled - else if (!c->AllowUnregistered() && !source.GetAccount()) + else if (hide_registered_commands && !c->AllowUnregistered() && !source.GetAccount()) continue; - else if (!info.permission.empty() && !source.HasCommand(info.permission)) + else if (hide_privileged_commands && !info.permission.empty() && !source.HasCommand(info.permission)) continue; source.command = it->first; diff --git a/modules/commands/ns_set.cpp b/modules/commands/ns_set.cpp index f4ecd044b..03ebae85c 100644 --- a/modules/commands/ns_set.cpp +++ b/modules/commands/ns_set.cpp @@ -33,7 +33,8 @@ class CommandNSSet : public Command source.Reply(_("Sets various nickname options. \037option\037 can be one of:")); Anope::string this_name = source.command; - bool hide_privileged_commands = Config->GetBlock("options")->Get("hideprivilegedcommands"); + bool hide_privileged_commands = Config->GetBlock("options")->Get("hideprivilegedcommands"), + hide_registered_commands = Config->GetBlock("options")->Get("hideregisteredcommands"); for (CommandInfo::map::const_iterator it = source.service->commands.begin(), it_end = source.service->commands.end(); it != it_end; ++it) { const Anope::string &c_name = it->first; @@ -42,13 +43,12 @@ class CommandNSSet : public Command if (c_name.find_ci(this_name + " ") == 0) { ServiceReference c("Command", info.name); + // XXX dup if (!c) continue; - else if (!hide_privileged_commands) - ; // Always show with hide_privileged_commands disabled - else if (!c->AllowUnregistered() && !source.GetAccount()) + else if (hide_registered_commands && !c->AllowUnregistered() && !source.GetAccount()) continue; - else if (!info.permission.empty() && !source.HasCommand(info.permission)) + else if (hide_privileged_commands && !info.permission.empty() && !source.HasCommand(info.permission)) continue; source.command = c_name; -- cgit From df6095fed2d86a1756aae06587fa6e9b46858408 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 3 Aug 2014 19:10:15 -0400 Subject: Make botserv fantasy override its own privilege --- modules/fantasy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/fantasy.cpp b/modules/fantasy.cpp index 0e24b10c5..58226699c 100644 --- a/modules/fantasy.cpp +++ b/modules/fantasy.cpp @@ -163,7 +163,7 @@ class Fantasy : public Module source.permission = info.permission; AccessGroup ag = c->ci->AccessFor(u); - bool has_fantasia = ag.HasPriv("FANTASIA") || source.HasPriv("chanserv/administration"); + bool has_fantasia = ag.HasPriv("FANTASIA") || source.HasPriv("botserv/fantasy"); EventReturn MOD_RESULT; if (has_fantasia) -- cgit From e5cb2018e578c0b84858d05d6aa3dae31b905f02 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 3 Aug 2014 19:15:08 -0400 Subject: List opertypes in /os oper info --- modules/commands/os_oper.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/commands/os_oper.cpp b/modules/commands/os_oper.cpp index 70256b254..370a974b4 100644 --- a/modules/commands/os_oper.cpp +++ b/modules/commands/os_oper.cpp @@ -69,7 +69,7 @@ class CommandOSOper : public Command this->SetDesc(_("View and change Services Operators")); this->SetSyntax(_("ADD \037oper\037 \037type\037")); this->SetSyntax(_("DEL \037oper\037")); - this->SetSyntax(_("INFO \037type\037")); + this->SetSyntax(_("INFO [\037type\037]")); this->SetSyntax("LIST"); } @@ -154,8 +154,19 @@ class CommandOSOper : public Command } } } - else if (subcommand.equals_ci("INFO") && params.size() > 1) + else if (subcommand.equals_ci("INFO")) { + if (params.size() < 2) + { + source.Reply(_("Available opertypes:")); + for (unsigned i = 0; i < Config->MyOperTypes.size(); ++i) + { + OperType *ot = Config->MyOperTypes[i]; + source.Reply("%s", ot->GetName().c_str()); + } + return; + } + Anope::string fulltype = params[1]; if (params.size() > 2) fulltype += " " + params[2]; -- cgit From d417241a5b87e1e717755aa851ba0977857db873 Mon Sep 17 00:00:00 2001 From: Robby- Date: Mon, 11 Aug 2014 20:16:42 +0200 Subject: cs_set: Fix logging for SET SUCCESSOR to correctly log overrides. --- modules/commands/cs_set.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/commands/cs_set.cpp b/modules/commands/cs_set.cpp index 77e1d1fd5..afd2c3547 100644 --- a/modules/commands/cs_set.cpp +++ b/modules/commands/cs_set.cpp @@ -1010,7 +1010,7 @@ class CommandCSSetSuccessor : public Command else nc = NULL; - Log(!source.permission.empty() ? LOG_ADMIN : LOG_COMMAND, source, this, ci) << "to change the successor from " << (ci->GetSuccessor() ? ci->GetSuccessor()->display : "(none)") << " to " << (nc ? nc->display : "(none)"); + Log(source.AccessFor(ci).HasPriv("SET") ? LOG_COMMAND : LOG_OVERRIDE, source, this, ci) << "to change the successor from " << (ci->GetSuccessor() ? ci->GetSuccessor()->display : "(none)") << " to " << (nc ? nc->display : "(none)"); ci->SetSuccessor(nc); -- cgit From bf8f62c32d6c66e38c167e6ca0ac59d29db52326 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 24 Aug 2014 16:39:04 -0400 Subject: Change Channel::GetModeList to return a copy of the mode list, not a pair of lower/upper bound iterators. Sometimes when iterating the list, like in cs_mode, we can modify the contents of it, which combined with mlock always agressively trying to readd modes to it can do bad things. --- modules/commands/cs_akick.cpp | 6 +++--- modules/commands/cs_mode.cpp | 13 ++++--------- modules/m_xmlrpc_main.cpp | 18 +++++++++--------- modules/pseudoclients/botserv.cpp | 6 +++--- modules/webcpanel/pages/chanserv/modes.cpp | 6 +++--- 5 files changed, 22 insertions(+), 27 deletions(-) (limited to 'modules') diff --git a/modules/commands/cs_akick.cpp b/modules/commands/cs_akick.cpp index 873b1cb43..1fac25335 100644 --- a/modules/commands/cs_akick.cpp +++ b/modules/commands/cs_akick.cpp @@ -71,10 +71,10 @@ class CommandCSAKick : public Command /* Check excepts BEFORE we get this far */ if (ci->c) { - std::pair modes = ci->c->GetModeList("EXCEPT"); - for (; modes.first != modes.second; ++modes.first) + std::vector modes = ci->c->GetModeList("EXCEPT"); + for (unsigned int i = 0; i < modes.size(); ++i) { - if (Anope::Match(modes.first->second, mask)) + if (Anope::Match(modes[i], mask)) { source.Reply(CHAN_EXCEPTED, mask.c_str(), ci->name.c_str()); return; diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp index 7f22d1e26..d5c356fa4 100644 --- a/modules/commands/cs_mode.cpp +++ b/modules/commands/cs_mode.cpp @@ -615,15 +615,10 @@ class CommandCSMode : public Command } else { - std::pair its = ci->c->GetModeList(cm->name); - for (; its.first != its.second;) - { - const Anope::string &mask = its.first->second; - ++its.first; - - if (Anope::Match(mask, param)) - ci->c->RemoveMode(NULL, cm, mask); - } + std::vector v = ci->c->GetModeList(cm->name); + for (unsigned j = 0; j < v.size(); ++j) + if (Anope::Match(v[j], param)) + ci->c->RemoveMode(NULL, cm, v[j]); } } } diff --git a/modules/m_xmlrpc_main.cpp b/modules/m_xmlrpc_main.cpp index 1a496c65c..13645bc98 100644 --- a/modules/m_xmlrpc_main.cpp +++ b/modules/m_xmlrpc_main.cpp @@ -155,21 +155,21 @@ class MyXMLRPCEvent : public XMLRPCEvent { request.reply("bancount", stringify(c->HasMode("BAN"))); int count = 0; - std::pair its = c->GetModeList("BAN"); - for (; its.first != its.second; ++its.first) - request.reply("ban" + stringify(++count), iface->Sanitize(its.first->second)); + std::vector v = c->GetModeList("BAN"); + for (unsigned int i = 0; i < v.size(); ++i) + request.reply("ban" + stringify(++count), iface->Sanitize(v[i])); request.reply("exceptcount", stringify(c->HasMode("EXCEPT"))); count = 0; - its = c->GetModeList("EXCEPT"); - for (; its.first != its.second; ++its.first) - request.reply("except" + stringify(++count), iface->Sanitize(its.first->second)); + v = c->GetModeList("EXCEPT"); + for (unsigned int i = 0; i < v.size(); ++i) + request.reply("except" + stringify(++count), iface->Sanitize(v[i])); request.reply("invitecount", stringify(c->HasMode("INVITEOVERRIDE"))); count = 0; - its = c->GetModeList("INVITEOVERRIDE"); - for (; its.first != its.second; ++its.first) - request.reply("invite" + stringify(++count), iface->Sanitize(its.first->second)); + v = c->GetModeList("INVITEOVERRIDE"); + for (unsigned int i = 0; i < v.size(); ++i) + request.reply("invite" + stringify(++count), iface->Sanitize(v[i])); Anope::string users; for (Channel::ChanUserList::const_iterator it = c->users.begin(); it != c->users.end(); ++it) diff --git a/modules/pseudoclients/botserv.cpp b/modules/pseudoclients/botserv.cpp index 48d604a6c..55c57b974 100644 --- a/modules/pseudoclients/botserv.cpp +++ b/modules/pseudoclients/botserv.cpp @@ -56,12 +56,12 @@ class BotServCore : public Module BotInfo *bi = user->server == Me ? dynamic_cast(user) : NULL; if (bi && Config->GetModule(this)->Get("smartjoin")) { - std::pair bans = c->GetModeList("BAN"); + std::vector bans = c->GetModeList("BAN"); /* We check for bans */ - for (; bans.first != bans.second; ++bans.first) + for (unsigned int i = 0; i < bans.size(); ++i) { - Entry ban("BAN", bans.first->second); + Entry ban("BAN", bans[i]); if (ban.Matches(user)) c->RemoveMode(NULL, "BAN", ban.GetMask()); } diff --git a/modules/webcpanel/pages/chanserv/modes.cpp b/modules/webcpanel/pages/chanserv/modes.cpp index d5b111708..e01239f58 100644 --- a/modules/webcpanel/pages/chanserv/modes.cpp +++ b/modules/webcpanel/pages/chanserv/modes.cpp @@ -94,9 +94,9 @@ bool WebCPanel::ChanServ::Modes::OnRequest(HTTPProvider *server, const Anope::st WebPanel::RunCommand(na->nc->display, na->nc, "ChanServ", "chanserv/mode", params, replacements); } - std::pair ml = c->GetModeList(cm->name); - for (; ml.first != ml.second; ++ml.first) - replacements["MASKS"] = HTTPUtils::Escape(ml.first->second); + std::vector v = c->GetModeList(cm->name); + for (unsigned int i = 0; i < v.size(); ++i) + replacements["MASKS"] = HTTPUtils::Escape(v[i]); } Page.Serve(server, page_name, client, message, reply, replacements); -- cgit From 3bdc81348aa2b795e4cdaf2a2ecbde80b70427d7 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 1 Sep 2014 13:11:21 -0400 Subject: Fix unserializing badwords to not add dupes when unserializing an existing bw object --- modules/commands/bs_badwords.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/commands/bs_badwords.cpp b/modules/commands/bs_badwords.cpp index 6deaa8924..a29c626a2 100644 --- a/modules/commands/bs_badwords.cpp +++ b/modules/commands/bs_badwords.cpp @@ -138,7 +138,8 @@ Serializable* BadWordImpl::Unserialize(Serializable *obj, Serialize::Data &data) bw->type = static_cast(n); BadWordsImpl *bws = ci->Require("badwords"); - bws->badwords->push_back(bw); + if (!obj) + bws->badwords->push_back(bw); return bw; } -- cgit From 8e7b742ec73a0a0c5a9ae1dc4ce246ebbe37c737 Mon Sep 17 00:00:00 2001 From: DukePyrolator Date: Sun, 14 Sep 2014 11:11:22 +0200 Subject: added missing support for operonly and silentoperonly in os_defcon --- modules/commands/os_defcon.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/commands/os_defcon.cpp b/modules/commands/os_defcon.cpp index c5074fd44..a618693d6 100644 --- a/modules/commands/os_defcon.cpp +++ b/modules/commands/os_defcon.cpp @@ -439,7 +439,16 @@ class OSDefcon : public Module EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector ¶ms) anope_override { - if (command->name == "nickserv/register" || command->name == "nickserv/group") + if (Config.Check(DEFCON_OPER_ONLY) && !source.IsOper()) + { + source.Reply(_("Services are in DefCon mode, please try again later.")); + return EVENT_STOP; + } + else if (DConfig.Check(DEFCON_SILENT_OPER_ONLY) && !source.IsOper()) + { + return EVENT_STOP; + } + else if (command->name == "nickserv/register" || command->name == "nickserv/group") { if (DConfig.Check(DEFCON_NO_NEW_NICKS)) { -- cgit From 4c2bf72cb642fc03de3eaf2591d84cb622609cb2 Mon Sep 17 00:00:00 2001 From: DukePyrolator Date: Sun, 14 Sep 2014 11:12:54 +0200 Subject: fixed typo in the last commit --- modules/commands/os_defcon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/commands/os_defcon.cpp b/modules/commands/os_defcon.cpp index a618693d6..247938049 100644 --- a/modules/commands/os_defcon.cpp +++ b/modules/commands/os_defcon.cpp @@ -439,7 +439,7 @@ class OSDefcon : public Module EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector ¶ms) anope_override { - if (Config.Check(DEFCON_OPER_ONLY) && !source.IsOper()) + if (DConfig.Check(DEFCON_OPER_ONLY) && !source.IsOper()) { source.Reply(_("Services are in DefCon mode, please try again later.")); return EVENT_STOP; -- cgit From 6a3f7c01b1232830f92c8ad6510071852d2abb30 Mon Sep 17 00:00:00 2001 From: DukePyrolator Date: Sun, 14 Sep 2014 11:36:05 +0200 Subject: changed the engine of the chanstats table from InnoDB back to MyISAM to avoid increasing the auto_increment counter on each INSERT IGNORE. For existing tables please manually run 'ALTER TABLE anope_chanstats ENGINE=MyISAM'. --- modules/extra/stats/m_chanstats.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/extra/stats/m_chanstats.cpp b/modules/extra/stats/m_chanstats.cpp index 4557b816f..7a2fe0486 100644 --- a/modules/extra/stats/m_chanstats.cpp +++ b/modules/extra/stats/m_chanstats.cpp @@ -309,7 +309,7 @@ class MChanstats : public Module "KEY `nick` (`nick`)," "KEY `chan_` (`chan`)," "KEY `type` (`type`)" - ") ENGINE=InnoDB DEFAULT CHARSET=utf8;"; + ") ENGINE=MyISAM DEFAULT CHARSET=utf8;"; this->RunQuery(query); } /* There is no CREATE OR REPLACE PROCEDURE in MySQL */ -- cgit From 18b3c572f46be91c64e50b1ac91f048790df7f2c Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 5 Oct 2014 16:22:39 -0400 Subject: ngircd doesn't allow sourceless messages --- modules/protocol/ngircd.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules') diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp index 86ced45ed..6078b87b8 100644 --- a/modules/protocol/ngircd.cpp +++ b/modules/protocol/ngircd.cpp @@ -169,6 +169,11 @@ class ngIRCdProto : public IRCDProto { this->SendVhost(u, u->GetIdent(), ""); } + + Anope::string Format(const Anope::string &source, const Anope::string &message) anope_override + { + return IRCDProto::Format(source.empty() ? Me->GetSID() : source, message); + } }; struct IRCDMessage005 : IRCDMessage -- cgit From b068874f406de030af3857d0ec7faa182c85d7ca Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 5 Oct 2014 19:07:26 -0400 Subject: Add a confirmation reply to ns recover on an unidentified user with svsnick --- modules/commands/ns_recover.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'modules') diff --git a/modules/commands/ns_recover.cpp b/modules/commands/ns_recover.cpp index 5bf38946b..f4945a639 100644 --- a/modules/commands/ns_recover.cpp +++ b/modules/commands/ns_recover.cpp @@ -97,6 +97,7 @@ class NSRecoverRequest : public IdentifyRequest /* If we can svsnick then release our hold and svsnick the user using the command */ nickserv->Release(na); IRCD->SendForceNickChange(source.GetUser(), GetAccount(), Anope::CurTime); + source.Reply(_("You have regained control of \002%s\002 and are now identified as \002%s\002."), GetAccount().c_str(), na->nc->display.c_str()); } else source.Reply(_("The user with your nick has been removed. Use this command again\n" -- cgit From 829ef1b7bd957425e4c1fd03abad404acfeb36ba Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 5 Oct 2014 19:53:48 -0400 Subject: Clear pending collided state on release, fixes colliding users using recover into enforcers --- modules/commands/ns_recover.cpp | 3 ++- modules/pseudoclients/nickserv.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/commands/ns_recover.cpp b/modules/commands/ns_recover.cpp index f4945a639..a412ad96a 100644 --- a/modules/commands/ns_recover.cpp +++ b/modules/commands/ns_recover.cpp @@ -95,7 +95,8 @@ class NSRecoverRequest : public IdentifyRequest if (IRCD->CanSVSNick) { /* If we can svsnick then release our hold and svsnick the user using the command */ - nickserv->Release(na); + if (nickserv) + nickserv->Release(na); IRCD->SendForceNickChange(source.GetUser(), GetAccount(), Anope::CurTime); source.Reply(_("You have regained control of \002%s\002 and are now identified as \002%s\002."), GetAccount().c_str(), na->nc->display.c_str()); } diff --git a/modules/pseudoclients/nickserv.cpp b/modules/pseudoclients/nickserv.cpp index 25c29a52f..a7941fc51 100644 --- a/modules/pseudoclients/nickserv.cpp +++ b/modules/pseudoclients/nickserv.cpp @@ -258,6 +258,7 @@ class NickServCore : public Module, public NickServService held.Unset(na); } + collided.Unset(na); /* clear pending collide */ } void OnReload(Configuration::Conf *conf) anope_override -- cgit From 31bc1d6b828f400a3e4f4fc56657b54f58e3ce1e Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 6 Oct 2014 08:04:33 -0400 Subject: Don't add duplicate akills in os_session --- modules/commands/os_session.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/commands/os_session.cpp b/modules/commands/os_session.cpp index 40412494e..41f3a420d 100644 --- a/modules/commands/os_session.cpp +++ b/modules/commands/os_session.cpp @@ -713,9 +713,10 @@ class OSSession : public Module } ++session->hits; - if (max_session_kill && session->hits >= max_session_kill && akills) + + const Anope::string &akillmask = "*@" + session->addr.mask(); + if (max_session_kill && session->hits >= max_session_kill && akills && !akills->HasEntry(akillmask)) { - const Anope::string &akillmask = "*@" + session->addr.mask(); XLine *x = new XLine(akillmask, OperServ ? OperServ->nick : "", Anope::CurTime + session_autokill_expiry, "Session limit exceeded", XLineManager::GenerateUID()); akills->AddXLine(x); akills->Send(NULL, x); -- cgit From be928b5bbc3f77050c4042bde151b370f4dd01e9 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 6 Oct 2014 13:52:43 -0400 Subject: Clean up collide timers on identify, otherwise you can login and logout before the timer tick which will still enforce the collide --- modules/pseudoclients/nickserv.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'modules') diff --git a/modules/pseudoclients/nickserv.cpp b/modules/pseudoclients/nickserv.cpp index a7941fc51..c299c0da3 100644 --- a/modules/pseudoclients/nickserv.cpp +++ b/modules/pseudoclients/nickserv.cpp @@ -11,6 +11,9 @@ #include "module.h" +class NickServCollide; +static std::set collides; + /** Timer for colliding nicks to force people off of nicknames */ class NickServCollide : public Timer @@ -23,6 +26,17 @@ class NickServCollide : public Timer public: NickServCollide(Module *me, NickServService *nss, User *user, NickAlias *nick, time_t delay) : Timer(me, delay), service(nss), u(user), ts(user->timestamp), na(nick) { + collides.insert(this); + } + + ~NickServCollide() + { + collides.erase(this); + } + + User *GetUser() + { + return u; } void Tick(time_t t) anope_override @@ -344,6 +358,16 @@ class NickServCore : public Module, public NickServService "Your privacy is respected; this e-mail won't be given to\n" "any third-party person."), Config->StrictPrivmsg.c_str(), NickServ->nick.c_str()); } + + for (std::set::iterator it = collides.begin(); it != collides.end(); ++it) + { + NickServCollide *c = *it; + if (c->GetUser() == u) + { + delete c; + break; + } + } } void OnNickGroup(User *u, NickAlias *target) anope_override -- cgit From 58233fb8bcc5c32f226e0bd37d3a8abe479e310e Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 6 Oct 2014 14:06:14 -0400 Subject: Log when memos are sent --- modules/commands/ms_send.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'modules') diff --git a/modules/commands/ms_send.cpp b/modules/commands/ms_send.cpp index f8f857607..5f3754cd0 100644 --- a/modules/commands/ms_send.cpp +++ b/modules/commands/ms_send.cpp @@ -47,7 +47,10 @@ class CommandMSSend : public Command MemoServService::MemoResult result = memoserv->Send(source.GetNick(), nick, text); if (result == MemoServService::MEMO_SUCCESS) + { source.Reply(_("Memo sent to \002%s\002."), nick.c_str()); + Log(LOG_COMMAND, source, this) << "to send a memo to " << nick; + } else if (result == MemoServService::MEMO_INVALID_TARGET) source.Reply(_("\002%s\002 is not a registered unforbidden nick or channel."), nick.c_str()); else if (result == MemoServService::MEMO_TOO_FAST) -- cgit From 96583892c6a0bc48029348ddcf86b1afc5a9915d Mon Sep 17 00:00:00 2001 From: Thomas Fargeix Date: Sat, 11 Oct 2014 22:56:31 +0200 Subject: Add a chanserv/access/list privilege Replace the existing chanserv/access/list command access, only used in cs_xop, by a privilege with the same name. It which allows read-only access to cs_access, cs_flags, cs_xop and cs_akick, while the already-existing chanserv/access/modify privilege allows to modify them. --- modules/commands/cs_access.cpp | 2 ++ modules/commands/cs_akick.cpp | 10 +++++++++- modules/commands/cs_flags.cpp | 2 ++ modules/commands/cs_xop.cpp | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp index d5f934862..309105998 100644 --- a/modules/commands/cs_access.cpp +++ b/modules/commands/cs_access.cpp @@ -518,6 +518,8 @@ class CommandCSAccess : public Command bool has_access = false; if (source.HasPriv("chanserv/access/modify")) has_access = true; + else if (is_list && source.HasPriv("chanserv/access/list")) + has_access = true; else if (is_list && source.AccessFor(ci).HasPriv("ACCESS_LIST")) has_access = true; else if (source.AccessFor(ci).HasPriv("ACCESS_CHANGE")) diff --git a/modules/commands/cs_akick.cpp b/modules/commands/cs_akick.cpp index 1fac25335..03db4c623 100644 --- a/modules/commands/cs_akick.cpp +++ b/modules/commands/cs_akick.cpp @@ -441,9 +441,17 @@ class CommandCSAKick : public Command return; } + bool is_list = cmd.equals_ci("LIST") || cmd.equals_ci("VIEW"); + + bool has_access = false; + if (source.AccessFor(ci).HasPriv("AKICK") || source.HasPriv("chanserv/access/modify")) + has_access = true; + else if (is_list && source.HasPriv("chanserv/access/list")) + has_access = true; + if (mask.empty() && (cmd.equals_ci("ADD") || cmd.equals_ci("DEL"))) this->OnSyntaxError(source, cmd); - else if (!source.AccessFor(ci).HasPriv("AKICK") && !source.HasPriv("chanserv/access/modify")) + else if (!has_access) source.Reply(ACCESS_DENIED); else if (!cmd.equals_ci("LIST") && !cmd.equals_ci("VIEW") && !cmd.equals_ci("ENFORCE") && Anope::ReadOnly) source.Reply(_("Sorry, channel autokick list modification is temporarily disabled.")); diff --git a/modules/commands/cs_flags.cpp b/modules/commands/cs_flags.cpp index 5f9e070fc..cb2e1fd9f 100644 --- a/modules/commands/cs_flags.cpp +++ b/modules/commands/cs_flags.cpp @@ -388,6 +388,8 @@ class CommandCSFlags : public Command bool has_access = false; if (source.HasPriv("chanserv/access/modify")) has_access = true; + else if (is_list && source.HasPriv("chanserv/access/list")) + has_access = true; else if (is_list && source.AccessFor(ci).HasPriv("ACCESS_LIST")) has_access = true; else if (source.AccessFor(ci).HasPriv("ACCESS_CHANGE")) diff --git a/modules/commands/cs_xop.cpp b/modules/commands/cs_xop.cpp index 340369901..bf86c06ce 100644 --- a/modules/commands/cs_xop.cpp +++ b/modules/commands/cs_xop.cpp @@ -365,7 +365,7 @@ class CommandCSXOP : public Command AccessGroup access = source.AccessFor(ci); - if (!access.HasPriv("ACCESS_LIST") && !source.HasCommand("chanserv/access/list")) + if (!access.HasPriv("ACCESS_LIST") && !source.HasPriv("chanserv/access/list")) { source.Reply(ACCESS_DENIED); return; -- cgit From 1c1297695894fd543554b1a063b1dee990594885 Mon Sep 17 00:00:00 2001 From: Thomas Fargeix Date: Sun, 12 Oct 2014 00:12:09 +0200 Subject: Add an operserv/oper/modify privilege. The operserv/oper command privilege allows to add operators with fewer or the same privileges as ourself. This new privilege allows to have operators who can use operserv/oper to see the list of operators and their privileges, but cannot add new operators. --- modules/commands/os_oper.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'modules') diff --git a/modules/commands/os_oper.cpp b/modules/commands/os_oper.cpp index 370a974b4..71cdf026c 100644 --- a/modules/commands/os_oper.cpp +++ b/modules/commands/os_oper.cpp @@ -82,6 +82,12 @@ class CommandOSOper : public Command const Anope::string &oper = params[1]; const Anope::string &otype = params[2]; + if (!source.HasPriv("operserv/oper/modify")) + { + source.Reply(ACCESS_DENIED); + return; + } + const NickAlias *na = NickAlias::Find(oper); if (na == NULL) source.Reply(NICK_X_NOT_REGISTERED, oper.c_str()); @@ -115,6 +121,12 @@ class CommandOSOper : public Command { const Anope::string &oper = params[1]; + if (!source.HasPriv("operserv/oper/modify")) + { + source.Reply(ACCESS_DENIED); + return; + } + const NickAlias *na = NickAlias::Find(oper); if (na == NULL) source.Reply(NICK_X_NOT_REGISTERED, oper.c_str()); -- cgit From 67719e8db1c4c5afecee3b7646adc407c9677774 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 12 Oct 2014 15:03:51 -0400 Subject: Add exempts and optionally allow authenticated users past m_dnsbl --- modules/m_dnsbl.cpp | 78 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 54 insertions(+), 24 deletions(-) (limited to 'modules') diff --git a/modules/m_dnsbl.cpp b/modules/m_dnsbl.cpp index 1c10b09d5..4adffd1f3 100644 --- a/modules/m_dnsbl.cpp +++ b/modules/m_dnsbl.cpp @@ -15,12 +15,29 @@ static ServiceReference dnsmanager("DNS::Manager", "dns/manager"); struct Blacklist { + struct Reply + { + int code; + Anope::string reason; + bool allow_account; + + Reply() : code(0), allow_account(false) { } + }; + Anope::string name; time_t bantime; Anope::string reason; - std::map replies; + std::vector replies; - Blacklist(const Anope::string &n, time_t b, const Anope::string &r, const std::map &re) : name(n), bantime(b), reason(r), replies(re) { } + Blacklist() : bantime(0) { } + + Reply *Find(int code) + { + for (unsigned int i = 0; i < replies.size(); ++i) + if (replies[i].code == code) + return &replies[i]; + return NULL; + } }; class DNSBLResolver : public Request @@ -42,17 +59,16 @@ class DNSBLResolver : public Request if (ans_record.rdata.find("127.0.0.") != 0) return; - Anope::string record_reason; - if (!this->blacklist.replies.empty()) - { - sockaddrs sresult; - sresult.pton(AF_INET, ans_record.rdata); - int result = sresult.sa4.sin_addr.s_addr >> 24; + sockaddrs sresult; + sresult.pton(AF_INET, ans_record.rdata); + int result = sresult.sa4.sin_addr.s_addr >> 24; - if (!this->blacklist.replies.count(result)) - return; - record_reason = this->blacklist.replies[result]; - } + Blacklist::Reply *reply = blacklist