diff options
| author | Robby <robby@chat.be> | 2012-01-07 04:10:30 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2012-01-07 04:10:30 -0500 |
| commit | 9e713941277e8d745b1713a6500349a9d1ecb8e3 (patch) | |
| tree | 8f6d8a8553316799154884f61573036c97ca0fff /modules | |
| parent | dd64eac782b3ee5acc6d1068a0ef42142a035254 (diff) | |
Cleaned up a lot of log messages, help replies, fixed cs_tban, and other small fixes
Diffstat (limited to 'modules')
26 files changed, 162 insertions, 149 deletions
diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp index ab132970d..ae1a848c9 100644 --- a/modules/commands/cs_access.cpp +++ b/modules/commands/cs_access.cpp @@ -162,7 +162,7 @@ class CommandCSAccess : public Command FOREACH_MOD(I_OnAccessAdd, OnAccessAdd(ci, u, access)); - Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "ADD " << mask << " as level " << level; + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to add " << mask << " with level " << level; source.Reply(_("\002%s\002 added to %s access list at level \002%d\002."), access->mask.c_str(), ci->name.c_str(), level); return; @@ -202,7 +202,7 @@ class CommandCSAccess : public Command source.Reply(_("No matching entries on %s access list."), ci->name.c_str()); else { - Log(override ? LOG_OVERRIDE : LOG_COMMAND, source.u, c, ci) << "for user" << (Deleted == 1 ? " " : "s ") << Nicks; + Log(override ? LOG_OVERRIDE : LOG_COMMAND, source.u, c, ci) << "to delete " << Nicks; if (Deleted == 1) source.Reply(_("Deleted 1 entry from %s access list."), ci->name.c_str()); @@ -261,7 +261,7 @@ class CommandCSAccess : public Command { source.Reply(_("\002%s\002 deleted from %s access list."), access->mask.c_str(), ci->name.c_str()); bool override = !u_access.Founder && !u_access.HasPriv("ACCESS_CHANGE") && !access->mask.equals_ci(u->Account()->display); - Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "DEL " << access->mask; + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to delete " << access->mask; FOREACH_MOD(I_OnAccessDel, OnAccessDel(ci, u, access)); ci->EraseAccess(access); @@ -417,7 +417,7 @@ class CommandCSAccess : public Command source.Reply(_("Channel %s access list has been cleared."), ci->name.c_str()); bool override = !IsFounder(u, ci); - Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "CLEAR"; + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to clear the access list"; } return; @@ -594,7 +594,7 @@ class CommandCSLevels : public Command FOREACH_MOD(I_OnLevelChange, OnLevelChange(u, ci, p->name, level)); bool override = !ci->AccessFor(u).HasPriv("FOUNDER"); - Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "SET " << p->name << " to " << level; + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to set " << p->name << " to level " << level; if (level == ACCESS_FOUNDER) source.Reply(_("Level for %s on channel %s changed to founder only."), p->name.c_str(), ci->name.c_str()); @@ -620,7 +620,7 @@ class CommandCSLevels : public Command FOREACH_MOD(I_OnLevelChange, OnLevelChange(u, ci, p->name, ACCESS_INVALID)); bool override = !ci->AccessFor(u).HasPriv("FOUNDER"); - Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "DISABLE " << p->name; + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to disable " << p->name; source.Reply(_("\002%s\002 disabled on channel %s."), p->name.c_str(), ci->name.c_str()); return; @@ -674,7 +674,7 @@ class CommandCSLevels : public Command FOREACH_MOD(I_OnLevelChange, OnLevelChange(u, ci, "ALL", 0)); bool override = !ci->AccessFor(u).HasPriv("FOUNDER"); - Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "RESET"; + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to reset all levels"; source.Reply(_("Access levels for \002%s\002 reset to defaults."), ci->name.c_str()); return; diff --git a/modules/commands/cs_akick.cpp b/modules/commands/cs_akick.cpp index 7d4ab4aea..47f174e59 100644 --- a/modules/commands/cs_akick.cpp +++ b/modules/commands/cs_akick.cpp @@ -152,7 +152,7 @@ class CommandCSAKick : public Command akick = ci->AddAkick(u->nick, mask, reason); bool override = !ci->AccessFor(u).HasPriv("AKICK"); - Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "ADD " << mask << ": " << reason; + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to add " << mask << (reason == "" ? "" : ": ") << reason; FOREACH_MOD(I_OnAkickAdd, OnAkickAdd(u, ci, akick)); @@ -192,7 +192,7 @@ class CommandCSAKick : public Command ~AkickDelCallback() { bool override = !ci->AccessFor(source.u).HasPriv("AKICK"); - Log(override ? LOG_OVERRIDE : LOG_COMMAND, source.u, c, ci) << "DEL on " << Deleted << " users"; + Log(override ? LOG_OVERRIDE : LOG_COMMAND, source.u, c, ci) << "to delete " << Deleted << (Deleted == 1 ? " entry" : " entries"); if (!Deleted) source.Reply(_("No matching entries on %s autokick list."), ci->name.c_str()); @@ -234,7 +234,7 @@ class CommandCSAKick : public Command } bool override = !ci->AccessFor(u).HasPriv("AKICK"); - Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "DEL " << mask; + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to delete " << mask; ci->EraseAkick(i); @@ -395,7 +395,7 @@ class CommandCSAKick : public Command { User *u = source.u; bool override = !ci->AccessFor(u).HasPriv("AKICK"); - Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "CLEAR"; + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to clear the akick list"; ci->ClearAkick(); source.Reply(_("Channel %s akick list has been cleared."), ci->name.c_str()); diff --git a/modules/commands/cs_appendtopic.cpp b/modules/commands/cs_appendtopic.cpp index 2c2b7253f..4186bdaff 100644 --- a/modules/commands/cs_appendtopic.cpp +++ b/modules/commands/cs_appendtopic.cpp @@ -45,6 +45,7 @@ class CommandCSAppendTopic : public Command CommandCSAppendTopic(Module *creator) : Command(creator, "chanserv/appendtopic", 2, 2) { this->SetDesc(_("Add text to a channels topic")); + this->SetSyntax(_("\037channel\037 \037text\037")); } void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) @@ -58,7 +59,7 @@ class CommandCSAppendTopic : public Command source.Reply(CHAN_X_NOT_IN_USE, params[0].c_str()); else if (!c->ci) source.Reply(CHAN_X_NOT_REGISTERED, c->name.c_str()); - else if (!c->ci->AccessFor(u).HasPriv("TOPIC")) + else if (!c->ci->AccessFor(u).HasPriv("TOPIC") && !u->HasCommand("chanserv/topic")) source.Reply(ACCESS_DENIED); else { @@ -77,15 +78,15 @@ class CommandCSAppendTopic : public Command if (has_topiclock) c->ci->SetFlag(CI_TOPICLOCK); - bool override = c->ci->AccessFor(u).HasPriv("TOPIC"); - Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, c->ci) << "changed topic to " << topic; + bool override = !c->ci->AccessFor(u).HasPriv("TOPIC"); + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, c->ci) << "to append: " << topic; } return; } bool OnHelp(CommandSource &source, const Anope::string &subcommand) { - source.Reply(_("Syntax: APPENDTOPIC channel text")); + this->SendSyntax(source); source.Reply(" "); source.Reply(_("This command allows users to append text to a currently set\n" "channel topic. When TOPICLOCK is on, the topic is updated and\n" @@ -93,11 +94,6 @@ class CommandCSAppendTopic : public Command return true; } - - void OnSyntaxError(CommandSource &source, const Anope::string &subcommand) - { - source.Reply(_("Syntax: APPENDTOPIC channel text")); - } }; class CSAppendTopic : public Module diff --git a/modules/commands/cs_ban.cpp b/modules/commands/cs_ban.cpp index 992ba9233..e0c5dd95e 100644 --- a/modules/commands/cs_ban.cpp +++ b/modules/commands/cs_ban.cpp @@ -19,8 +19,8 @@ class CommandCSBan : public Command CommandCSBan(Module *creator) : Command(creator, "chanserv/ban", 2, 3) { this->SetDesc(_("Bans a selected nick on a channel")); - this->SetSyntax(_("\037#channel\037 \037nick\037 [\037reason\037]")); - this->SetSyntax(_("\037#channel\037 \037mask\037 [\037reason\037]")); + this->SetSyntax(_("\037channel\037 \037nick\037 [\037reason\037]")); + this->SetSyntax(_("\037channel\037 \037mask\037 [\037reason\037]")); } void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) @@ -127,7 +127,7 @@ class CommandCSBan : public Command source.Reply(" "); source.Reply(_("Bans a selected nick on a channel.\n" " \n" - "By default, limited to AOPs or those with level 5 access \n" + "By default, limited to AOPs or those with level 5 access\n" "and above on the channel. Channel founders may ban masks.")); return true; } diff --git a/modules/commands/cs_clearusers.cpp b/modules/commands/cs_clearusers.cpp index 59f7a71ab..e65aa34eb 100644 --- a/modules/commands/cs_clearusers.cpp +++ b/modules/commands/cs_clearusers.cpp @@ -40,7 +40,7 @@ class CommandCSClearUsers : public Command source.Reply(CHAN_X_NOT_REGISTERED, c->name.c_str()); return; } - else if (!c->ci->AccessFor(u).HasPriv("FOUNDER")) + else if (!c->ci->AccessFor(u).HasPriv("FOUNDER") && !u->HasCommand("chanserv/clearusers")) { source.Reply(ACCESS_DENIED); return; @@ -55,7 +55,10 @@ class CommandCSClearUsers : public Command c->Kick(NULL, uc->user, "%s", buf.c_str()); } - source.Reply(_("All users have been kicked from \2%s\2."), chan.c_str()); + bool override = !c->ci->AccessFor(u).HasPriv("FOUNDER"); + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, c->ci); + + source.Reply(_("All users have been kicked from \002%s\002."), chan.c_str()); return; } @@ -64,7 +67,7 @@ class CommandCSClearUsers : public Command { this->SendSyntax(source); source.Reply(" "); - source.Reply(_("Tells %s to clear (kick) all users certain settings on a channel." + source.Reply(_("Tells %s to clear (kick) all users on a channel." " \n" "By default, limited to those with founder access on the\n" "channel."), source.owner->nick.c_str()); diff --git a/modules/commands/cs_clone.cpp b/modules/commands/cs_clone.cpp index cd55e40b0..905a26177 100644 --- a/modules/commands/cs_clone.cpp +++ b/modules/commands/cs_clone.cpp @@ -53,12 +53,6 @@ public: return; } - if (Config->CSMaxReg && u->Account()->channelcount >= Config->CSMaxReg && !u->HasPriv("chanserv/no-register-limit")) - { - source.Reply(u->Account()->channelcount > Config->CSMaxReg ? CHAN_EXCEEDED_CHANNEL_LIMIT : _(CHAN_REACHED_CHANNEL_LIMIT), Config->CSMaxReg); - return; - } - if (what.equals_ci("ALL")) what.clear(); @@ -107,7 +101,7 @@ public: FOREACH_MOD(I_OnChanRegistered, OnChanRegistered(target_ci)); - source.Reply(_("All settings from \002%s\002 have been transferred to \002%s\002"), channel.c_str(), target.c_str()); + source.Reply(_("All settings from \002%s\002 have been cloned to \002%s\002"), channel.c_str(), target.c_str()); } else if (what.equals_ci("ACCESS")) { @@ -127,7 +121,7 @@ public: target_ci->AddAccess(newaccess); } - source.Reply(_("All access entries from \002%s\002 have been transferred to \002%s\002"), channel.c_str(), target.c_str()); + source.Reply(_("All access entries from \002%s\002 have been cloned to \002%s\002"), channel.c_str(), target.c_str()); } else if (what.equals_ci("AKICK")) { @@ -141,7 +135,7 @@ public: target_ci->AddAkick(akick->creator, akick->mask, akick->reason, akick->addtime, akick->last_used); } - source.Reply(_("All akick entries from \002%s\002 have been transferred to \002%s\002"), channel.c_str(), target.c_str()); + source.Reply(_("All akick entries from \002%s\002 have been cloned to \002%s\002"), channel.c_str(), target.c_str()); } else if (what.equals_ci("BADWORDS")) { @@ -152,7 +146,7 @@ public: target_ci->AddBadWord(bw->word, bw->type); } - source.Reply(_("All badword entries from \002%s\002 have been transferred to \002%s\002"), channel.c_str(), target.c_str()); + source.Reply(_("All badword entries from \002%s\002 have been cloned to \002%s\002"), channel.c_str(), target.c_str()); } else { @@ -160,7 +154,7 @@ public: return; } - Log(LOG_COMMAND, u, this, ci) << "to clone it to " << target_ci->name; + Log(LOG_COMMAND, u, this, ci) << "to clone " << (what.empty() ? "everything from it" : what) << " to " << target_ci->name; return; } @@ -169,9 +163,9 @@ public: { this->SendSyntax(source); source.Reply(" "); - source.Reply(_("Copies all settings, access, akicks, etc from channel to the\n" - "target channel. If \037what\037 is access, akick, or badwords\n" - "then only the respective settings are transferred.\n" + source.Reply(_("Copies all settings, access, akicks, etc from \002channel\002 to the\n" + "\002target\002 channel. If \037what\037 is \002ACCESS\002, \002AKICK\002, or \002BADWORDS\002\n" + "then only the respective settings are cloned.\n" "You must be the founder of \037channel\037 and \037target\037.")); return true; } diff --git a/modules/commands/cs_drop.cpp b/modules/commands/cs_drop.cpp index 6a6913aaf..429f70ad1 100644 --- a/modules/commands/cs_drop.cpp +++ b/modules/commands/cs_drop.cpp @@ -57,7 +57,7 @@ class CommandCSDrop : public Command ci->c->RemoveMode(NULL, CMODE_REGISTERED, "", false); bool override = (ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !ci->AccessFor(u).HasPriv("FOUNDER")); - Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "founder: " << (ci->GetFounder() ? ci->GetFounder()->display : "none"); + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "(founder was: " << (ci->GetFounder() ? ci->GetFounder()->display : "none") << ")"; delete ci; diff --git a/modules/commands/cs_entrymsg.cpp b/modules/commands/cs_entrymsg.cpp index 36e0770db..758c3f96c 100644 --- a/modules/commands/cs_entrymsg.cpp +++ b/modules/commands/cs_entrymsg.cpp @@ -79,11 +79,11 @@ class CommandEntryMessage : public Command EntryMessageList *messages = ci->GetExt<EntryMessageList *>("cs_entrymsg"); if (messages == NULL) { - source.Reply(_("Entry message list for \2%s\2 is empty."), ci->name.c_str()); + source.Reply(_("Entry message list for \002%s\002 is empty."), ci->name.c_str()); return; } - source.Reply(_("Entry message list for \2%s\2:"), ci->name.c_str()); + source.Reply(_("Entry message list for \002%s\002:"), ci->name.c_str()); ListFormatter list; list.addColumn("Number").addColumn("Creator").addColumn("Created").addColumn("Message"); @@ -117,11 +117,11 @@ class CommandEntryMessage : public Command } if (MaxEntries && messages->size() >= MaxEntries) - source.Reply(_("The entry message list for \2%s\2 is full."), ci->name.c_str()); + source.Reply(_("The entry message list for \002%s\002 is full."), ci->name.c_str()); else { messages->push_back(EntryMsg(ci, source.u->nick, message)); - source.Reply(_("Entry message added to \2%s\2"), ci->name.c_str()); + source.Reply(_("Entry message added to \002%s\002"), ci->name.c_str()); } } @@ -140,24 +140,24 @@ class CommandEntryMessage : public Command messages->erase(messages->begin() + i - 1); if (messages->empty()) ci->Shrink("cs_entrymsg"); - source.Reply(_("Entry message \2%i\2 for \2%s\2 deleted."), i, ci->name.c_str()); + source.Reply(_("Entry message \002%i\002 for \002%s\002 deleted."), i, ci->name.c_str()); } else throw ConvertException(); } catch (const ConvertException &) { - source.Reply(_("Entry message \2%s\2 not found on channel \2%s\2."), message.c_str(), ci->name.c_str()); + source.Reply(_("Entry message \002%s\002 not found on channel \002%s\002."), message.c_str(), ci->name.c_str()); } } else - source.Reply(_("Entry message list for \2%s\2 is empty."), ci->name.c_str()); + source.Reply(_("Entry message list for \002%s\002 is empty."), ci->name.c_str()); } void DoClear(CommandSource &source, ChannelInfo *ci) { ci->Shrink("cs_entrymsg"); - source.Reply(_("Entry messages for \2%s\2 have been cleared."), ci->name.c_str()); + source.Reply(_("Entry messages for \002%s\002 have been cleared."), ci->name.c_str()); } public: @@ -178,7 +178,7 @@ class CommandEntryMessage : public Command return; } - if (IsFounder(u, ci) || u->HasCommand("chanserv/entrymsg")) + if (IsFounder(u, ci) || u->HasCommand("chanserv/set")) { bool success = true; if (params[1].equals_ci("LIST")) @@ -200,7 +200,7 @@ class CommandEntryMessage : public Command this->OnSyntaxError(source, ""); } if (success) - Log(IsFounder(u, ci) ? LOG_COMMAND : LOG_OVERRIDE, u, this, ci) << params[1]; + Log(IsFounder(u, ci) ? LOG_COMMAND : LOG_OVERRIDE, u, this, ci) << " to " << params[1] << " a message"; } else source.Reply(ACCESS_DENIED); @@ -227,7 +227,7 @@ class CSEntryMessage : public Module { this->SetAuthor("Anope"); - Implementation i[] = { I_OnReload, I_OnJoinChannel };
+ Implementation i[] = { I_OnReload, I_OnJoinChannel }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); this->OnReload(); diff --git a/modules/commands/cs_flags.cpp b/modules/commands/cs_flags.cpp index 7f7dc7b84..811730e27 100644 --- a/modules/commands/cs_flags.cpp +++ b/modules/commands/cs_flags.cpp @@ -174,6 +174,7 @@ class CommandCSFlags : public Command { FOREACH_MOD(I_OnAccessDel, OnAccessDel(ci, u, current)); ci->EraseAccess(current); + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to delete " << mask; source.Reply(_("\002%s\002 removed from the %s access list."), mask.c_str(), ci->name.c_str()); } else @@ -201,7 +202,7 @@ class CommandCSFlags : public Command FOREACH_MOD(I_OnAccessAdd, OnAccessAdd(ci, u, access)); - Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "MODIFY " << mask << " with flags " << access->Serialize(); + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to modify " << mask << "'s flags to " << access->Serialize(); source.Reply(_("Access for \002%s\002 on %s set to +\002%s\002"), access->mask.c_str(), ci->name.c_str(), access->Serialize().c_str()); return; @@ -284,7 +285,7 @@ class CommandCSFlags : public Command source.Reply(_("Channel %s access list has been cleared."), ci->name.c_str()); bool override = !IsFounder(u, ci); - Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "CLEAR"; + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to clear the access list"; } return; diff --git a/modules/commands/cs_getkey.cpp b/modules/commands/cs_getkey.cpp index 4fc028c63..287ed82b0 100644 --- a/modules/commands/cs_getkey.cpp +++ b/modules/commands/cs_getkey.cpp @@ -44,7 +44,7 @@ class CommandCSGetKey : public Command Anope::string key; if (!ci->c || !ci->c->GetParam(CMODE_KEY, key)) { - source.Reply(_("The channel \002%s\002 has no key."), chan.c_str()); + source.Reply(_("Channel \002%s\002 has no key."), chan.c_str()); return; } diff --git a/modules/commands/cs_info.cpp b/modules/commands/cs_info.cpp index 4f733fb60..b86755d58 100644 --- a/modules/commands/cs_info.cpp +++ b/modules/commands/cs_info.cpp @@ -125,8 +125,8 @@ class CommandCSInfo : public Command source.Reply(" "); source.Reply(_("Lists information about the named registered channel,\n" "including its founder, time of registration, last time\n" - "used, description, and mode lock, if any. If \002ALL\002 is \n" - "specified, the entry message and successor will also \n" + "used, description, and mode lock, if any. If \002ALL\002 is\n" + "specified, the entry message and successor will also\n" "be displayed.")); return true; } diff --git a/modules/commands/cs_invite.cpp b/modules/commands/cs_invite.cpp index a05d325b6..7dc4b9f7d 100644 --- a/modules/commands/cs_invite.cpp +++ b/modules/commands/cs_invite.cpp @@ -18,8 +18,8 @@ class CommandCSInvite : public Command public: CommandCSInvite(Module *creator) : Command(creator, "chanserv/invite", 1, 3) { - this->SetDesc(_("Invites you into a channel")); - this->SetSyntax(_("\037channel\037")); + this->SetDesc(_("Invites you or an optionally specified nick into a channel")); + this->SetSyntax(_("\037channel\037 [\037nick\037]")); } void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) @@ -42,7 +42,7 @@ class CommandCSInvite : public Command return; } - if (!ci->AccessFor(u).HasPriv("INVITE")) + if (!ci->AccessFor(u).HasPriv("INVITE") && !u->HasCommand("chanserv/invite")) { source.Reply(ACCESS_DENIED); return; @@ -60,15 +60,27 @@ class CommandCSInvite : public Command } } - // XXX need a check for override... - Log(LOG_COMMAND, u, this, ci) << "for " << u2->nick; - if (c->FindUser(u2)) - source.Reply(_("You are already in \002%s\002! "), c->name.c_str()); + { + if (u2 == u) + source.Reply(_("You are already in \002%s\002!"), c->name.c_str()); + else + source.Reply(_("\002%s\002 is already in \002%s\002!"), u2->nick.c_str(), c->name.c_str()); + } else { + bool override = !ci->AccessFor(u).HasPriv("INVITE"); + ircdproto->SendInvite(ci->WhoSends(), chan, u2->nick); - source.Reply(_("\002%s\002 has been invited to \002%s\002."), u2->nick.c_str(), c->name.c_str()); + if (u2 != u) + { + source.Reply(_("\002%s\002 has been invited to \002%s\002."), u2->nick.c_str(), c->name.c_str()); + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "for " << u2->nick; + } + else + { + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci); + } u2->SendMessage(ci->WhoSends(), _("You have been invited to \002%s\002."), c->name.c_str()); } return; @@ -78,7 +90,8 @@ class CommandCSInvite : public Command { this->SendSyntax(source); source.Reply(" "); - source.Reply(_("Tells %s to invite you into the given channel.\n" + 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" "on the channel."), source.owner->nick.c_str()); diff --git a/modules/commands/cs_kick.cpp b/modules/commands/cs_kick.cpp index 56d6b152f..09d51b39f 100644 --- a/modules/commands/cs_kick.cpp +++ b/modules/commands/cs_kick.cpp @@ -20,6 +20,7 @@ class CommandCSKick : public Command { this->SetDesc(_("Kicks a selected nick from a channel")); this->SetSyntax(_("\037channel\037 \037nick\037 [\037reason\037]")); + this->SetSyntax(_("\037channel\037 \037mask\037 [\037reason\037]")); } void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) @@ -110,9 +111,8 @@ class CommandCSKick : public Command source.Reply(" "); source.Reply(_("Kicks a selected nick on a channel.\n" " \n" - "By default, limited to AOPs or those with level 5 access \n" - "and above on the channel. Channel founders may include wildcards\n" - "in \037nick\037.")); + "By default, limited to AOPs or those with level 5 access\n" + "and above on the channel. Channel founders may use masks too.")); return true; } }; diff --git a/modules/commands/cs_log.cpp b/modules/commands/cs_log.cpp index 164398d63..a94608b4c 100644 --- a/modules/commands/cs_log.cpp +++ b/modules/commands/cs_log.cpp @@ -32,7 +32,7 @@ public: ChannelInfo *ci = cs_findchan(channel); if (ci == NULL) source.Reply(CHAN_X_NOT_REGISTERED, channel.c_str()); - else if (!ci->AccessFor(u).HasPriv("SET")) + else if (!ci->AccessFor(u).HasPriv("SET") && !u->HasPriv("chanserv/set")) source.Reply(ACCESS_DENIED); else if (params.size() == 1) { @@ -108,6 +108,8 @@ public: return; } + bool override = !ci->AccessFor(u).HasPriv("SET"); + for (unsigned i = ci->log_settings.size(); i > 0; --i) { LogSetting &log = ci->log_settings[i - 1]; @@ -117,12 +119,14 @@ public: if (log.extra == extra) { ci->log_settings.erase(ci->log_settings.begin() + i - 1); - source.Reply(_("Logging for command %s on %s with method %s%s has been removed."), command_name.c_str(), bi->nick.c_str(), method.c_str(), extra.empty() ? "" : extra.c_str()); + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to remove logging for " << command << " with method " << method << (extra == "" ? "" : " ") << extra; + source.Reply(_("Logging for command %s on %s with log method %s%s%s has been removed."), command_name.c_str(), bi->nick.c_str(), method.c_str(), extra.empty() ? "" : " ", extra.empty() ? "" : extra.c_str()); } else { log.extra = extra; - source.Reply(_("Logging changed for command %s on %s, using log method %s %s"), command_name.c_str(), bi->nick.c_str(), method.c_str(), extra.c_str()); + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to change logging for " << command << " to method " << method << (extra == "" ? "" : " ") << extra; + source.Reply(_("Logging changed for command %s on %s, now using log method %s%s%s."), command_name.c_str(), bi->nick.c_str(), method.c_str(), extra.empty() ? "" : " ", extra.empty() ? "" : extra.c_str()); } return; } @@ -139,9 +143,9 @@ public: log.creator = u->nick; ci->log_settings.push_back(log); - Log(LOG_COMMAND, u, this, ci) << command << " " << method << " " << extra; + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to log " << command << " with method " << method << (extra == "" ? "" : " ") << extra; - source.Reply(_("Logging is now active for command %s on %s, using log method %s %s"), command_name.c_str(), bi->nick.c_str(), method.c_str(), extra.c_str()); + source.Reply(_("Logging is now active for command %s on %s, using log method %s%s%s."), command_name.c_str(), bi->nick.c_str(), method.c_str(), extra.empty() ? "" : " ", extra.empty() ? "" : extra.c_str()); } else this->OnSyntaxError(source, ""); diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp index 676304fa3..f2e6479c1 100644 --- a/modules/commands/cs_mode.cpp +++ b/modules/commands/cs_mode.cpp @@ -46,6 +46,8 @@ class CommandCSMode : public Command const Anope::string &subcommand = params[2]; const Anope::string ¶m = params.size() > 3 ? params[3] : ""; + bool override = !ci->AccessFor(u).HasPriv("MODE"); + if (subcommand.equals_ci("ADD") && !param.empty()) { spacesepstream sep(param); @@ -88,7 +90,7 @@ class CommandCSMode : public Command if (!mode_param.empty()) mode_param = " " + mode_param; source.Reply(_("%c%c%s locked on %s"), adding ? '+' : '-', cm->ModeChar, mode_param.c_str(), ci->name.c_str()); - Log(LOG_COMMAND, u, this, ci) << "to lock " << (adding ? '+' : '-') << cm->ModeChar << mode_param; + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to lock " << (adding ? '+' : '-') << cm->ModeChar << mode_param; } } } @@ -139,7 +141,7 @@ class CommandCSMode : public Command if (!mode_param.empty()) mode_param = " " + mode_param; source.Reply(_("%c%c%s has been unlocked from %s."), adding == 1 ? '+' : '-', cm->ModeChar, mode_param.c_str(), ci->name.c_str()); - Log(LOG_COMMAND, u, this, ci) << "to unlock " << (adding ? '+' : '-') << cm->ModeChar << mode_param; + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to unlock " << (adding ? '+' : '-') << cm->ModeChar << mode_param; } else source.Reply(_("%c is not locked on %s."), cm->ModeChar, ci->name.c_str()); @@ -194,7 +196,8 @@ class CommandCSMode : public Command spacesepstream sep(params.size() > 3 ? params[3] : ""); Anope::string modes = params[2], param; - Log(LOG_COMMAND, u, this, ci) << "to set " << params[2]; + bool override = !ci->AccessFor(u).HasPriv("MODE"); + Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to set " << params[2]; int adding = -1; for (size_t i = 0; i < modes.length(); ++i) @@ -345,7 +348,7 @@ class CommandCSMode : public Command if (!ci || !ci->c) source.Reply(CHAN_X_NOT_IN_USE, params[0].c_str()); - else if (!ci->AccessFor(u).HasPriv("MODE") && !u->HasCommand("chanserv/mode")) + else if (!ci->AccessFor(u).HasPriv("MODE") && !u->HasPriv("chanserv/set")) source.Reply(ACCESS_DENIED); else if (subcommand.equals_ci("LOCK")) this->DoLock(source, ci, params); diff --git a/modules/commands/cs_modes.cpp b/modules/commands/cs_modes.cpp index 0e11fe1b5..0e1f9ef64 100644 --- a/modules/commands/cs_modes.cpp +++ b/modules/commands/cs_modes.cpp @@ -59,7 +59,7 @@ class CommandModeBase : public Command * @param chan The channel its being set on * @param nick The nick the modes being set on * @param set Is the mode being set or removed - * @param level The acecss level required to set this mode on someone else + * @param level The access level required to set this mode on someone else * @param levelself The access level required to set this mode on yourself */ void do_util(CommandSource &source, Command *com, ChannelMode *cm, const Anope::string &chan, const Anope::string &nick, bool set, const Anope::string &level, const Anope::string &levelself) @@ -78,7 +78,7 @@ class CommandModeBase : public Command public: CommandModeBase(Module *creator, const Anope::string &cname) : |
