]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
Fix the problems GreenReaper found with the windows select engine, this has never...
[user/henk/code/inspircd.git] / src / users.cpp
index 6efbee651db6eeea062d169fc3efeeb0e5b41efb..108ce138559dfb4b6a0d9e76fb000a824d7d9ed6 100644 (file)
@@ -859,6 +859,25 @@ void User::CheckClass()
        this->MaxChans = a->GetMaxChans();
 }
 
+void User::CheckLines()
+{
+       const char* check[] = { "G" , "K", NULL };
+
+       if (!this->exempt)
+       {
+               for (int n = 0; check[n]; ++n)
+               {
+                       XLine *r = ServerInstance->XLines->MatchesLine(check[n], this);
+
+                       if (r)
+                       {
+                               r->Apply(this);
+                               return;
+                       }
+               }
+       }
+}
+
 void User::FullConnect()
 {
        ServerInstance->stats->statsConnects++;
@@ -881,24 +900,7 @@ void User::FullConnect()
                return;
        }
 
-       if (!this->exempt)
-       {
-               GLine *r = (GLine *)ServerInstance->XLines->MatchesLine("G", this);
-
-               if (r)
-               {
-                       r->Apply(this);
-                       return;
-               }
-
-               KLine *n = (KLine *)ServerInstance->XLines->MatchesLine("K", this);
-
-               if (n)
-               {
-                       n->Apply(this);
-                       return;
-               }
-       }
+       CheckLines();
 
        this->WriteServ("NOTICE Auth :Welcome to \002%s\002!",ServerInstance->Config->Network);
        this->WriteNumeric(001, "%s :Welcome to the %s IRC Network %s!%s@%s",this->nick, ServerInstance->Config->Network, this->nick, this->ident, this->host);
@@ -1096,7 +1098,7 @@ const char* User::GetIPString(bool translate4in6)
                        {
                                strlcpy(&temp[1], buf, sizeof(temp) - 1);
                                *temp = '0';
-                               if (translate4in6 && !strncmp(GetIPString(), "0::ffff:", 8))
+                               if (translate4in6 && !strncmp(temp, "0::ffff:", 8))
                                {
                                        this->cachedip = temp + 8;
                                        return temp + 8;