summaryrefslogtreecommitdiff
path: root/src/modules/m_uninvite.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_uninvite.cpp')
-rw-r--r--src/modules/m_uninvite.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/modules/m_uninvite.cpp b/src/modules/m_uninvite.cpp
index 10fd7c7b6..3ee23c95a 100644
--- a/src/modules/m_uninvite.cpp
+++ b/src/modules/m_uninvite.cpp
@@ -20,8 +20,6 @@
*/
-/* $ModDesc: Provides the UNINVITE command which lets users un-invite other users from channels (!) */
-
#include "inspircd.h"
/** Handle /UNINVITE
@@ -32,7 +30,7 @@ class CommandUninvite : public Command
CommandUninvite(Module* Creator) : Command(Creator,"UNINVITE", 2)
{
syntax = "<nick> <channel>";
- TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
+ TRANSLATE2(TR_NICK, TR_TEXT);
}
CmdResult Handle (const std::vector<std::string> &parameters, User *user)
@@ -70,15 +68,13 @@ class CommandUninvite : public Command
LocalUser* lu = IS_LOCAL(u);
if (lu)
{
- irc::string xname(c->name.c_str());
- if (!lu->IsInvited(xname))
+ if (!lu->RemoveInvite(c))
{
user->SendText(":%s 505 %s %s %s :Is not invited to channel %s", user->server.c_str(), user->nick.c_str(), u->nick.c_str(), c->name.c_str(), c->name.c_str());
return CMD_FAILURE;
}
user->SendText(":%s 494 %s %s %s :Uninvited", user->server.c_str(), user->nick.c_str(), c->name.c_str(), u->nick.c_str());
- lu->RemoveInvite(xname);
lu->WriteNumeric(493, "%s :You were uninvited from %s by %s", u->nick.c_str(), c->name.c_str(), user->nick.c_str());
std::string msg = "*** " + user->nick + " uninvited " + u->nick + ".";
@@ -106,20 +102,15 @@ class ModuleUninvite : public Module
{
}
- void init()
+ void init() CXX11_OVERRIDE
{
ServerInstance->Modules->AddService(cmd);
}
- virtual ~ModuleUninvite()
- {
- }
-
- virtual Version GetVersion()
+ Version GetVersion() CXX11_OVERRIDE
{
return Version("Provides the UNINVITE command which lets users un-invite other users from channels", VF_VENDOR | VF_OPTCOMMON);
}
};
MODULE_INIT(ModuleUninvite)
-