summaryrefslogtreecommitdiff
path: root/src/modules/m_uninvite.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-21 23:45:32 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-21 23:45:32 +0000
commitff3eef491aa9e107d09d9dd9560ef7715b37b3b3 (patch)
tree76532ed5d9dd8ec0deb86793bc72d548e7a4c76a /src/modules/m_uninvite.cpp
parent123eac3f25ce4dd3142b4ac66eb321f7df1e23e4 (diff)
Move all local-only fields to LocalUser
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11944 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_uninvite.cpp')
-rw-r--r--src/modules/m_uninvite.cpp31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/modules/m_uninvite.cpp b/src/modules/m_uninvite.cpp
index 1215dd0df..fff51817e 100644
--- a/src/modules/m_uninvite.cpp
+++ b/src/modules/m_uninvite.cpp
@@ -56,28 +56,29 @@ class CommandUninvite : public Command
irc::string xname(c->name.c_str());
- if (!u->IsInvited(xname))
+ if (IS_LOCAL(u))
{
- user->WriteNumeric(505, "%s %s %s :Is not invited to channel %s", user->nick.c_str(), u->nick.c_str(), c->name.c_str(), c->name.c_str());
- return CMD_FAILURE;
- }
- if (!c->HasUser(user))
- {
- user->WriteNumeric(492, "%s %s :You're not on that channel!",user->nick.c_str(), c->name.c_str());
- return CMD_FAILURE;
+ // TODO send messages & such out to remote servers
+ LocalUser* lu = IS_LOCAL(u);
+ if (!lu->IsInvited(xname))
+ {
+ user->WriteNumeric(505, "%s %s %s :Is not invited to channel %s", user->nick.c_str(), u->nick.c_str(), c->name.c_str(), c->name.c_str());
+ return CMD_FAILURE;
+ }
+ user->WriteNumeric(494, "%s %s %s :Uninvited", 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());
+ c->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :*** %s uninvited %s.",
+ c->name.c_str(), user->nick.c_str(), u->nick.c_str());
}
- u->RemoveInvite(xname);
- user->WriteNumeric(494, "%s %s %s :Uninvited", user->nick.c_str(), c->name.c_str(), u->nick.c_str());
- u->WriteNumeric(493, "%s :You were uninvited from %s by %s", u->nick.c_str(), c->name.c_str(), user->nick.c_str());
- c->WriteChannelWithServ(ServerInstance->Config->ServerName.c_str(), "NOTICE %s :*** %s uninvited %s.", c->name.c_str(), user->nick.c_str(), u->nick.c_str());
-
return CMD_SUCCESS;
}
RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
{
- return ROUTE_BROADCAST;
+ User* u = ServerInstance->FindNick(parameters[0]);
+ return u ? ROUTE_UNICAST(u->server) : ROUTE_LOCALONLY;
}
};
@@ -98,7 +99,7 @@ class ModuleUninvite : public Module
virtual Version GetVersion()
{
- return Version("Provides the UNINVITE command which lets users un-invite other users from channels (!)", VF_VENDOR | VF_COMMON);
+ return Version("Provides the UNINVITE command which lets users un-invite other users from channels", VF_VENDOR | VF_COMMON);
}
};