X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fchannels.cpp;h=1ef761a66b9e0a606fcb52ea73f96341a3148666;hb=a245aa22076e17e72c84e5a0f5699209cdf62727;hp=a6ed3406d28bbe62f79167b3a86d484258b293b1;hpb=d2a71fd3447c8bac65cc26077e2b9fc3fb0b28a7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/channels.cpp b/src/channels.cpp index a6ed3406d..1ef761a66 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -262,14 +262,6 @@ Channel* Channel::JoinUser(InspIRCd* Instance, User *user, const char* cn, bool { // Checking MyClass exists because we *may* get here with NULL, not 100% sure. if (user->MyClass && user->MyClass->GetMaxChans()) - { - if (user->chans.size() >= user->MyClass->GetMaxChans()) - { - user->WriteNumeric(ERR_TOOMANYCHANNELS, "%s %s :You are on too many channels",user->nick.c_str(), cn); - return NULL; - } - } - else { if (user->HasPrivPermission("channels/high-join-limit")) { @@ -595,52 +587,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)