summaryrefslogtreecommitdiff
path: root/src/channels.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-05-13 05:27:46 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-05-13 05:27:46 +0000
commit23a98c8fe1f255fe5f20c26c726da817d2796c9a (patch)
treef5b4d0dd6eafb1d583fc17d3dde8c23d348d8fda /src/channels.cpp
parent6dd331262aa8f989657891e27b8891ee6a00016c (diff)
Use a FakeUser source for server-sourced commands in spanningtree
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11376 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/channels.cpp')
-rw-r--r--src/channels.cpp45
1 files changed, 2 insertions, 43 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index a6ed3406d..0532a70e2 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -595,52 +595,11 @@ long Channel::PartUser(User *user, std::string &reason)
long Channel::ServerKickUser(User* user, const char* reason, const char* servername)
{
- bool silent = false;
-
- if (!user || !reason)
- return this->GetUserCounter();
-
- if (IS_LOCAL(user))
- {
- if (!this->HasUser(user))
- {
- /* Not on channel */
- return this->GetUserCounter();
- }
- }
-
if (servername == NULL || *ServerInstance->Config->HideWhoisServer)
servername = ServerInstance->Config->ServerName;
- FOREACH_MOD(I_OnUserKick,OnUserKick(NULL, user, this, reason, silent));
-
- UCListIter i = user->chans.find(this);
- if (i != user->chans.end())
- {
- if (!silent)
- this->WriteChannelWithServ(servername, "KICK %s %s :%s", this->name.c_str(), user->nick.c_str(), reason);
-
- user->chans.erase(i);
- this->RemoveAllPrefixes(user);
- }
-
- if (!this->DelUser(user))
- {
- chan_hash::iterator iter = ServerInstance->chanlist->find(this->name);
- /* kill the record */
- if (iter != ServerInstance->chanlist->end())
- {
- int MOD_RESULT = 0;
- FOREACH_RESULT_I(ServerInstance,I_OnChannelPreDelete, OnChannelPreDelete(this));
- if (MOD_RESULT == 1)
- return 1; // delete halted by module
- FOREACH_MOD(I_OnChannelDelete, OnChannelDelete(this));
- ServerInstance->chanlist->erase(iter);
- }
- return 0;
- }
-
- return this->GetUserCounter();
+ ServerInstance->FakeClient->server = servername;
+ return this->KickUser(ServerInstance->FakeClient, user, reason);
}
long Channel::KickUser(User *src, User *user, const char* reason)