]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/channels.cpp
This should probably be tested, but makes a whole lot more sense like this (users...
[user/henk/code/inspircd.git] / src / channels.cpp
index 5dde871177d7355f0a1a8a8f85b18154d44262ff..effc47d73572a38ebb1c62b5a8f2fb956bc95015 100644 (file)
@@ -20,7 +20,7 @@
 
 Channel::Channel(InspIRCd* Instance, const std::string &cname, time_t ts) : ServerInstance(Instance)
 {
-       chan_hash::iterator findchan = ServerInstance->chanlist->find(name);
+       chan_hash::iterator findchan = ServerInstance->chanlist->find(cname);
        if (findchan != Instance->chanlist->end())
                throw CoreException("Cannot create duplicate channel " + cname);
 
@@ -467,7 +467,6 @@ bool Channel::IsExtBanned(User *user, char type)
                maskptr = i->data;
                maskptr++; // past the char
                maskptr++; // past the :
-printf("realmask: %s\n", maskptr);
 
                /* This allows CIDR ban matching
                 * 
@@ -524,7 +523,7 @@ long Channel::PartUser(User *user, const char* reason)
        return this->GetUserCounter();
 }
 
-long Channel::ServerKickUser(User* user, const char* reason, bool triggerevents)
+long Channel::ServerKickUser(User* user, const char* reason, bool triggerevents, const char* servername)
 {
        bool silent = false;
 
@@ -540,6 +539,9 @@ long Channel::ServerKickUser(User* user, const char* reason, bool triggerevents)
                }
        }
 
+       if (servername == NULL)
+               servername = ServerInstance->Config->ServerName;
+
        if (triggerevents)
        {
                FOREACH_MOD(I_OnUserKick,OnUserKick(NULL, user, this, reason, silent));
@@ -549,7 +551,7 @@ long Channel::ServerKickUser(User* user, const char* reason, bool triggerevents)
        if (i != user->chans.end())
        {
                if (!silent)
-                       this->WriteChannelWithServ(ServerInstance->Config->ServerName, "KICK %s %s :%s", this->name, user->nick, reason);
+                       this->WriteChannelWithServ(servername, "KICK %s %s :%s", this->name, user->nick, reason);
 
                user->chans.erase(i);
                this->RemoveAllPrefixes(user);