diff options
author | Adam <Adam@anope.org> | 2017-02-06 14:23:18 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2017-02-06 14:23:18 -0500 |
commit | 8b694bc392c36551e428b84454efb81cdbc8bcd3 (patch) | |
tree | ca3d1ca8aadac280c149518134de4208f91dad84 /modules/chanserv/invite.cpp | |
parent | 9ad06f49bbb3824139b0c0ee0a74898a18c8f735 (diff) |
Track override in CommandSource and use it in the logger
Diffstat (limited to 'modules/chanserv/invite.cpp')
-rw-r--r-- | modules/chanserv/invite.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/chanserv/invite.cpp b/modules/chanserv/invite.cpp index ae6cee04d..6e996dfb7 100644 --- a/modules/chanserv/invite.cpp +++ b/modules/chanserv/invite.cpp @@ -48,7 +48,7 @@ class CommandCSInvite : public Command return; } - if (!source.AccessFor(ci).HasPriv("INVITE") && !source.HasCommand("chanserv/invite")) + if (!source.AccessFor(ci).HasPriv("INVITE") && !source.HasOverrideCommand("chanserv/invite")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "INVITE", ci->GetName()); return; @@ -76,19 +76,17 @@ class CommandCSInvite : public Command return; } - bool override = !source.AccessFor(ci).HasPriv("INVITE"); - IRCD->Send<messages::Invite>(ci->WhoSends(), c, u2); if (u2 != u) { source.Reply(_("\002{0}\002 has been invited to \002{1}\002."), u2->nick, c->name); u2->SendMessage(ci->WhoSends(), _("You have been invited to \002{0}\002 by \002{1}\002."), c->name, source.GetNick()); - logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel} to invite {0}"), u2->nick); + logger.Command(source, ci, _("{source} used {command} on {channel} to invite {0}"), u2->nick); } else { u2->SendMessage(ci->WhoSends(), _("You have been invited to \002{0}\002."), c->name); - logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel}")); + logger.Command(source, ci, _("{source} used {command} on {channel}")); } } |