summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2015-01-05 16:31:09 -0500
committerAdam <Adam@anope.org>2015-01-05 19:00:51 -0500
commitd79d8e2608e304760c42bdf87502e3bc51781b88 (patch)
tree179913b8b328f88d52d84c3453fceb28a2d63422 /modules
parent8ab1c71d7dc7a0d47e5711dc72e3fc9c3ee850bb (diff)
parentc46ec39e5088119cd21f5f7e16e64e61a876ca20 (diff)
Merge branch '2.0' into 2.1
Conflicts: CMakeLists.txt include/modules.h include/serialize.h modules/commands/bs_assign.cpp modules/commands/bs_badwords.cpp modules/commands/bs_bot.cpp modules/commands/bs_control.cpp modules/commands/bs_kick.cpp modules/commands/cs_access.cpp modules/commands/cs_akick.cpp modules/commands/cs_drop.cpp modules/commands/cs_entrymsg.cpp modules/commands/cs_flags.cpp modules/commands/cs_info.cpp modules/commands/cs_invite.cpp modules/commands/cs_kick.cpp modules/commands/cs_mode.cpp modules/commands/cs_register.cpp modules/commands/cs_seen.cpp modules/commands/cs_set.cpp modules/commands/cs_suspend.cpp modules/commands/cs_topic.cpp modules/commands/cs_unban.cpp modules/commands/cs_xop.cpp modules/commands/hs_del.cpp modules/commands/hs_list.cpp modules/commands/hs_request.cpp modules/commands/ms_ignore.cpp modules/commands/ms_send.cpp modules/commands/ns_recover.cpp modules/commands/ns_register.cpp modules/commands/ns_suspend.cpp modules/commands/os_dns.cpp modules/commands/os_noop.cpp modules/commands/os_oper.cpp modules/commands/os_session.cpp modules/database/db_sql_live.cpp modules/encryption/enc_bcrypt.cpp modules/extra/m_ldap_authentication.cpp modules/extra/m_ldap_oper.cpp modules/fantasy.cpp modules/m_dnsbl.cpp modules/m_sasl.cpp modules/protocol/hybrid.cpp modules/protocol/inspircd20.cpp modules/protocol/unreal.cpp modules/pseudoclients/chanserv.cpp modules/pseudoclients/nickserv.cpp modules/webcpanel/pages/chanserv/access.cpp modules/webcpanel/webcpanel.cpp modules/webcpanel/webcpanel.h src/command.cpp src/messages.cpp src/modulemanager.cpp src/regchannel.cpp src/serialize.cpp
Diffstat (limited to 'modules')
-rw-r--r--modules/commands/bs_assign.cpp2
-rw-r--r--modules/commands/bs_badwords.cpp2
-rw-r--r--modules/commands/bs_control.cpp2
-rw-r--r--modules/commands/bs_set.cpp11
-rw-r--r--modules/commands/cs_access.cpp6
-rw-r--r--modules/commands/cs_akick.cpp12
-rw-r--r--modules/commands/cs_flags.cpp34
-rw-r--r--modules/commands/cs_info.cpp2
-rw-r--r--modules/commands/cs_mode.cpp15
-rw-r--r--modules/commands/cs_register.cpp6
-rw-r--r--modules/commands/cs_seen.cpp12
-rw-r--r--modules/commands/cs_set.cpp12
-rw-r--r--modules/commands/cs_suspend.cpp4
-rw-r--r--modules/commands/cs_topic.cpp30
-rw-r--r--modules/commands/cs_xop.cpp8
-rw-r--r--modules/commands/hs_request.cpp6
-rw-r--r--modules/commands/ms_ignore.cpp6
-rw-r--r--modules/commands/ms_send.cpp13
-rw-r--r--modules/commands/ns_recover.cpp6
-rw-r--r--modules/commands/ns_register.cpp10
-rw-r--r--modules/commands/ns_set.cpp10
-rw-r--r--modules/commands/ns_suspend.cpp4
-rw-r--r--modules/commands/os_akill.cpp6
-rw-r--r--modules/commands/os_defcon.cpp26
-rw-r--r--modules/commands/os_kick.cpp7
-rw-r--r--modules/commands/os_kill.cpp2
-rw-r--r--modules/commands/os_noop.cpp4
-rw-r--r--modules/commands/os_oper.cpp37
-rw-r--r--modules/commands/os_session.cpp52
-rw-r--r--modules/commands/os_sxline.cpp16
-rw-r--r--modules/encryption/enc_bcrypt.cpp2
-rw-r--r--modules/extra/m_ldap.cpp4
-rw-r--r--modules/extra/m_ldap_authentication.cpp8
-rw-r--r--modules/extra/m_ldap_oper.cpp8
-rw-r--r--modules/extra/m_sasl_dh-aes.cpp2
-rw-r--r--modules/extra/m_sasl_dh-blowfish.cpp4
-rw-r--r--modules/extra/stats/m_chanstats.cpp2
-rw-r--r--modules/fantasy.cpp2
-rw-r--r--modules/m_dnsbl.cpp78
-rw-r--r--modules/m_sasl.cpp14
-rw-r--r--modules/m_xmlrpc_main.cpp18
-rw-r--r--modules/protocol/bahamut.cpp6
-rw-r--r--modules/protocol/hybrid.cpp5
-rw-r--r--modules/protocol/inspircd20.cpp44
-rw-r--r--modules/protocol/ngircd.cpp27
-rw-r--r--modules/protocol/plexus.cpp3
-rw-r--r--modules/protocol/unreal.cpp3
-rw-r--r--modules/pseudoclients/botserv/botserv.cpp6
-rw-r--r--modules/pseudoclients/chanserv/chanserv.cpp8
-rw-r--r--modules/pseudoclients/nickserv/nickserv.cpp10
-rw-r--r--modules/webcpanel/pages/chanserv/access.cpp103
-rw-r--r--modules/webcpanel/pages/chanserv/modes.cpp6
-rw-r--r--modules/webcpanel/webcpanel.cpp39
-rw-r--r--modules/webcpanel/webcpanel.h4
54 files changed, 474 insertions, 295 deletions
diff --git a/modules/commands/bs_assign.cpp b/modules/commands/bs_assign.cpp
index 4312a9254..840651dfc 100644
--- a/modules/commands/bs_assign.cpp
+++ b/modules/commands/bs_assign.cpp
@@ -134,7 +134,7 @@ class CommandBSUnassign : public Command
if (ci->HasFieldS("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;
}
diff --git a/modules/commands/bs_badwords.cpp b/modules/commands/bs_badwords.cpp
index 22488a1c0..0f8e9e7d0 100644
--- a/modules/commands/bs_badwords.cpp
+++ b/modules/commands/bs_badwords.cpp
@@ -350,7 +350,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;
}
diff --git a/modules/commands/bs_control.cpp b/modules/commands/bs_control.cpp
index fc97cd163..52c0933c5 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"));
}
diff --git a/modules/commands/bs_set.cpp b/modules/commands/bs_set.cpp
index 2abea91b2..6e2ae998f 100644
--- a/modules/commands/bs_set.cpp
+++ b/modules/commands/bs_set.cpp
@@ -31,6 +31,8 @@ class CommandBSSet : public Command
source.Reply(_("Configures bot options.\n"
"\n"
"Available options:"));
+ bool hide_privileged_commands = Config->GetBlock("options")->Get<bool>("hideprivilegedcommands"),
+ hide_registered_commands = Config->GetBlock("options")->Get<bool>("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)
{
@@ -41,6 +43,13 @@ class CommandBSSet : public Command
ServiceReference<Command> 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);
}
@@ -102,7 +111,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;
}
diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp
index ae4a291a0..6f1f0f1f0 100644
--- a/modules/commands/cs_access.cpp
+++ b/modules/commands/cs_access.cpp
@@ -162,6 +162,7 @@ class CommandCSAccess : public Command
else
{
na = NickServ::FindNick(mask);
+
if (!na && Config->GetModule("chanserv")->Get<bool>("disallow_hostmask_access"))
{
source.Reply(_("Masks and unregistered users may not be on access lists."));
@@ -179,6 +180,9 @@ class CommandCSAccess : public Command
return;
}
}
+
+ if (na)
+ mask = na->GetNick();
}
for (unsigned i = ci->GetAccessCount(); i > 0; --i)
@@ -502,6 +506,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 08da7537f..8cd1f778a 100644
--- a/modules/commands/cs_akick.cpp
+++ b/modules/commands/cs_akick.cpp
@@ -195,10 +195,10 @@ class CommandCSAKick : public Command
/* Check excepts BEFORE we get this far */
if (ci->c)
{
- std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> modes = ci->c->GetModeList("EXCEPT");
- for (; modes.first != modes.second; ++modes.first)
+ std::vector<Anope::string> 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(_("\002{0}\002 matches an except on \002{1}\002 and cannot be banned until the except has been removed."), mask, ci->GetName());
return;
@@ -547,19 +547,21 @@ class CommandCSAKick : public Command
return;
}
+ bool is_list = cmd.equals_ci("LIST") || cmd.equals_ci("VIEW");
+
if (mask.empty() && (cmd.equals_ci("ADD") || cmd.equals_ci("DEL")))
{
this->OnSyntaxError(source, cmd);
return;
}
- if (!source.AccessFor(ci).HasPriv("AKICK") && !source.HasPriv("chanserv/access/modify"))
+ if (!source.AccessFor(ci).HasPriv("AKICK") && !source.HasPriv("chanserv/access/modify") && (!is_list || source.HasPriv("chanserv/access/list")))
{
source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "AKICK", ci->GetName());
return;
}
- if (Anope::ReadOnly && (cmd.equals_ci("ADD") || cmd.equals_ci("DEL")))
+ if (Anope::ReadOnly && (cmd.equals_ci("ADD") || cmd.equals_ci("DEL") || cmd.equals_ci("CLEAR")))
{
source.Reply(_("Sorry, channel autokick list modification is temporarily disabled."));
return;
diff --git a/modules/commands/cs_flags.cpp b/modules/commands/cs_flags.cpp
index 03edc28e9..c8ef11796 100644
--- a/modules/commands/cs_flags.cpp
+++ b/modules/commands/cs_flags.cpp
@@ -82,11 +82,8 @@ void FlagsChanAccess::SetFlags(const Anope::string &i)
class CommandCSFlags : public Command
{
- void DoModify(CommandSource &source, ChanServ::Channel *ci, const std::vector<Anope::string> &params)
+ void DoModify(CommandSource &source, ChanServ::Channel *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, "");
@@ -140,6 +137,9 @@ class CommandCSFlags : public Command
return;
}
}
+
+ if (na)
+ mask = na->GetNick();
}
ChanServ::ChanAccess *current = NULL;
@@ -149,7 +149,7 @@ class CommandCSFlags : public Command
for (current_idx = ci->GetAccessCount(); current_idx > 0; --current_idx)
{
ChanServ::ChanAccess *access = ci->GetAccess(current_idx - 1);
- if (mask.equals_ci(access->Mask()))
+ if ((na && na->GetAccount() == access->GetAccount()) || mask.equals_ci(access->Mask()))
{
// Flags allows removing others that have the same access as you,
// but no other access system does.
@@ -375,7 +375,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"));
}
@@ -396,6 +396,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"))
@@ -413,14 +415,26 @@ class CommandCSFlags : public Command
return;
}
- if (cmd.equals_ci("MODIFY"))
- this->DoModify(source, ci, params);
- else if (is_list)
+ 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) override
diff --git a/modules/commands/cs_info.cpp b/modules/commands/cs_info.cpp
index 43405a18d..267aee66a 100644
--- a/modules/commands/cs_info.cpp
+++ b/modules/commands/cs_info.cpp
@@ -19,7 +19,7 @@ class CommandCSInfo : public Command
public:
CommandCSInfo(Module *creator, EventHandlers<Event::ChanInfo> &event) : Command(creator, "chanserv/info", 1, 2), eventonchaninfo(event)
{
- 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);
}
diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp
index d0dea2625..67d1e5faa 100644
--- a/modules/commands/cs_mode.cpp
+++ b/modules/commands/cs_mode.cpp
@@ -321,6 +321,8 @@ class CommandCSMode : public Command
source.Reply(_("Missing parameter for mode \002{0}\002."), 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 \002{0}\002 is full."), cm->mchar);
+ else if (ci->GetRefs<ModeLock *>(modelock).size() >= Config->GetModule(this->owner)->Get<unsigned>("max", "32"))
+ source.Reply(_("The mode lock list of \002{0}\002 is full."), ci->GetName());
else
{
mlocks->SetMLock(ci, cm, adding, mode_param, source.GetNick());
@@ -605,15 +607,10 @@ class CommandCSMode : public Command
}
else
{
- std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> 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<Anope::string> 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/commands/cs_register.cpp b/modules/commands/cs_register.cpp
index 33b271ce5..eb2832074 100644
--- a/modules/commands/cs_register.cpp
+++ b/modules/commands/cs_register.cpp
@@ -72,7 +72,7 @@ class CommandCSRegister : public Command
return;
}
- if (c && !c->HasUserStatus(u, "OP"))
+ if (c && u && !c->HasUserStatus(u, "OP"))
{
source.Reply(_("You must be a channel operator to register the channel."));
return;
@@ -113,9 +113,9 @@ class CommandCSRegister : public Command
c->CheckModes();
if (u)
c->SetCorrectModes(u, true);
- }
- Event::OnChanRegistered(&Event::ChanRegistered::OnChanRegistered, ci);
+ Event::OnChanRegistered(&Event::ChanRegistered::OnChanRegistered, ci);
+ }
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
diff --git a/modules/commands/cs_seen.cpp b/modules/commands/cs_seen.cpp
index b46b2efc5..b97ffe238 100644
--- a/modules/commands/cs_seen.cpp
+++ b/modules/commands/cs_seen.cpp
@@ -171,6 +171,7 @@ class CommandOSSeen : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
{
+<<<<<<< HEAD
source.Reply(_("The \002STATS\002 command prints out statistics about stored nicks and memory usage.\n"
"The \002CLEAR\002 command lets you clean the database by removing all entries from the entries from the database that were added within \037time\037.\n"
"\n"
@@ -178,6 +179,17 @@ class CommandOSSeen : public Command
" {0} CLEAR 30m\n"
" Will remove all entries that were added within the last 30 minutes."),
source.command);
+=======
+ this->SendSyntax(source);
+ 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"
+ "database that were added within \037time\037.\n"
+ " \n"
+ "Example:\n"
+ " %s CLEAR 30m\n"
+ " Will remove all entries that were added within the last 30 minutes."), source.command.c_str());
+>>>>>>> 2.0
return true;
}
};
diff --git a/modules/commands/cs_set.cpp b/modules/commands/cs_set.cpp
index 2f0e2dd4f..f7ee80050 100644
--- a/modules/commands/cs_set.cpp
+++ b/modules/commands/cs_set.cpp
@@ -37,7 +37,8 @@ class CommandCSSet : public Command
"\n"
"Available options:"));
Anope::string this_name = source.command;
- bool hide_privileged_commands = Config->GetBlock("options")->Get<bool>("hideprivilegedcommands");
+ bool hide_privileged_commands = Config->GetBlock("options")->Get<bool>("hideprivilegedcommands"),
+ hide_registered_commands = Config->GetBlock("options")->Get<bool>("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;
@@ -46,13 +47,12 @@ class CommandCSSet : public Command
{
ServiceReference<Command> 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;
@@ -989,7 +989,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()->GetDisplay() : "(none)") << " to " << (nc ? nc->GetDisplay() : "(none)");
+ Log(source.AccessFor(ci).HasPriv("SET") ? LOG_COMMAND : LOG_OVERRIDE, source, this, ci) << "to change the successor from " << (ci->GetSuccessor() ? ci->GetSuccessor()->GetDisplay() : "(none)") << " to " << (nc ? nc->GetDisplay() : "(none)");
ci->SetSuccessor(nc);
diff --git a/modules/commands/cs_suspend.cpp b/modules/commands/cs_suspend.cpp
index 58b4617f0..73a034192 100644
--- a/modules/commands/cs_suspend.cpp
+++ b/modules/commands/cs_suspend.cpp
@@ -289,9 +289,9 @@ class CSSuspend : public Module
if (!si->GetReason().empty() && (show_hidden || Show(source, "reason")))
info[_("Suspend reason")] = si->GetReason();
if (si->GetWhen() && (show_hidden || Show(source, "on")))
- info[_("Suspended on")] = Anope::strftime(si->GetWhen(), source.GetAccount(), true);
+ info[_("Suspended on")] = Anope::strftime(si->GetWhen(), source.GetAccount());
if (si->GetExpires() && (show_hidden || Show(source, "expires")))
- info[_("Suspension expires")] = Anope::strftime(si->GetExpires(), source.GetAccount(), true);
+ info[_("Suspension expires")] = Anope::strftime(si->GetExpires(), source.GetAccount());
}
void OnPreChanExpire(ChanServ::Channel *ci, bool &expire) override
diff --git a/modules/commands/cs_topic.cpp b/modules/commands/cs_topic.cpp
index 49a5a0043..9e8b3764a 100644
--- a/modules/commands/cs_topic.cpp
+++ b/modules/commands/cs_topic.cpp
@@ -115,10 +115,8 @@ class CommandCSTopic : public Command
source.Reply(_("Topic lock option for \002{0}\002 is now \002off\002."), ci->GetName());
}
- void Set(CommandSource &source, ChanServ::Channel *ci, const std::vector<Anope::string> &params)
+ void Set(CommandSource &source, ChanServ::Channel *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);
@@ -142,12 +140,7 @@ class CommandCSTopic : public Command
else
new_topic = topic;
- std::vector<Anope::string> new_params;
- new_params.push_back("SET");
- new_params.push_back(ci->GetName());
- new_params.push_back(new_topic);
-
- this->Set(source, ci, new_params);
+ this->Set(source, ci, new_topic);
}
public:
@@ -155,7 +148,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]"));
}
@@ -176,12 +169,23 @@ class CommandCSTopic : public Command
this->Unlock(source, ci, params);
else if (!ci->c)
source.Reply(_("Channel \002{0}\002 doesn't exist."), ci->GetName());
- 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) override
diff --git a/modules/commands/cs_xop.cpp b/modules/commands/cs_xop.cpp
index cc39ad8b9..0de467f4f 100644
--- a/modules/commands/cs_xop.cpp
+++ b/modules/commands/cs_xop.cpp
@@ -173,6 +173,7 @@ class CommandCSXOP : public Command
else
{
na = NickServ::FindNick(mask);
+
if (!na && Config->GetModule("chanserv")->Get<bool>("disallow_hostmask_access"))
{
source.Reply(_("Masks and unregistered users may not be on access lists."));
@@ -190,13 +191,16 @@ class CommandCSXOP : public Command
return;
}
}
+
+ if (na)
+ mask = na->GetNick();
}
for (unsigned i = 0; i < ci->GetAccessCount(); ++i)
{
ChanServ::ChanAccess *a = ci->GetAccess(i);
- if (a->Mask().equals_ci(mask))
+ if ((na && na->GetAccount() == a->GetAccount()) || mask.equals_ci(a->Mask()))
{
if ((!highest || *a >= *highest) && !access.founder && !source.HasPriv("chanserv/access/modify"))
{
@@ -361,7 +365,7 @@ class CommandCSXOP : public Command
ChanServ::AccessGroup access = source.AccessFor(ci);
- if (!access.HasPriv("ACCESS_LIST") && !source.HasCommand("chanserv/access/list"))
+ if (!access.HasPriv("ACCESS_LIST") && !source.HasPriv("c