- char mask[MAXBUF];
- snprintf(mask, MAXBUF, "%s!%s@%s", user->nick.c_str(), user->ident.c_str(), user->GetIPString());
-
- rv = rv + this->GetExtBanStatus(mask, type);
- rv = rv + this->GetExtBanStatus(user->GetFullHost(), type);
- rv = rv + this->GetExtBanStatus(user->GetFullRealHost(), type);
- return rv;
-}
-
-/* Channel::PartUser
- * remove a channel from a users record, and return the number of users left.
- * Therefore, if this function returns 0 the caller should delete the Channel.
- */
-long Channel::PartUser(User *user, std::string &reason)
-{
- bool silent = false;
-
- if (!user)
- return this->GetUserCounter();
-
- UCListIter i = user->chans.find(this);
- if (i != user->chans.end())
- {
- FOREACH_MOD(I_OnUserPart,OnUserPart(user, this, reason, silent));
-
- if (!silent)
- this->WriteChannel(user, "PART %s%s%s", this->name.c_str(), reason.empty() ? "" : " :", reason.c_str());
-
- user->chans.erase(i);
- this->RemoveAllPrefixes(user);
- }
-
- if (!this->DelUser(user)) /* if there are no users left on the channel... */
- {
- chan_hash::iterator iter = ServerInstance->chanlist->find(this->name);
- /* kill the record */
- if (iter != ServerInstance->chanlist->end())
- {
- ModResult res;
- FIRST_MOD_RESULT(ServerInstance, OnChannelPreDelete, res, (this));
- if (res == MOD_RES_DENY)
- return 1; // delete halted by module
- FOREACH_MOD(I_OnChannelDelete, OnChannelDelete(this));
- ServerInstance->chanlist->erase(iter);
- }
- return 0;
- }
-
- return this->GetUserCounter();
-}
-
-long Channel::ServerKickUser(User* user, const char* reason, const char* servername)
-{
- if (servername == NULL || *ServerInstance->Config->HideWhoisServer)
- servername = ServerInstance->Config->ServerName;
-
- ServerInstance->FakeClient->server = servername;
- return this->KickUser(ServerInstance->FakeClient, user, reason);
-}
-
-long Channel::KickUser(User *src, User *user, const char* reason)
-{
- bool silent = false;
-
- if (!src || !user || !reason)
- return this->GetUserCounter();