X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_uninvite.cpp;h=cbddedd2b904579a60cea30ce249fbd888f53626;hb=cbd32e195f5f574653550a3ed4954168ace30c55;hp=c44e15511d61e698547eadb0fa30eacf5c16fcf6;hpb=6d03943426dcce76ba66567a9b18425a5ebb4c0c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_uninvite.cpp b/src/modules/m_uninvite.cpp index c44e15511..cbddedd2b 100644 --- a/src/modules/m_uninvite.cpp +++ b/src/modules/m_uninvite.cpp @@ -2,7 +2,7 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2009 InspIRCd Development Team + * InspIRCd: (C) 2002-2010 InspIRCd Development Team * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see @@ -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, "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& parameters) { - return ROUTE_BROADCAST; + User* u = ServerInstance->FindNick(parameters[0]); + return u ? ROUTE_OPT_UCAST(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, API_VERSION); + return Version("Provides the UNINVITE command which lets users un-invite other users from channels", VF_VENDOR | VF_OPTCOMMON); } };