]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree.cpp
Decide that it wasn't quite appropriate :(
[user/henk/code/inspircd.git] / src / modules / m_spanningtree.cpp
index 0b1013a15bdac1fb6d7325e9f21875a961143798..1374c88a2e9f839573ec3bc8367d81856a82ad42 100644 (file)
@@ -896,7 +896,7 @@ class TreeSocket : public InspSocket
                        {
                                std::string oldtopic = c->topic;
                                strlcpy(c->topic,params[3].c_str(),MAXTOPIC);
-                               strlcpy(c->setby,params[2].c_str(),NICKMAX);
+                               strlcpy(c->setby,params[2].c_str(),NICKMAX-1);
                                c->topicset = ts;
                                /* if the topic text is the same as the current topic,
                                 * dont bother to send the TOPIC command out, just silently
@@ -1091,7 +1091,7 @@ class TreeSocket : public InspSocket
 
                clientlist[tempnick] = new userrec();
                clientlist[tempnick]->fd = FD_MAGIC_NUMBER;
-               strlcpy(clientlist[tempnick]->nick, tempnick,NICKMAX);
+               strlcpy(clientlist[tempnick]->nick, tempnick,NICKMAX-1);
                strlcpy(clientlist[tempnick]->host, params[2].c_str(),160);
                strlcpy(clientlist[tempnick]->dhost, params[3].c_str(),160);
                clientlist[tempnick]->server = (char*)FindServerNamePtr(source.c_str());
@@ -1444,7 +1444,7 @@ class TreeSocket : public InspSocket
                userrec* u = Srv->FindNick(prefix);
                if (u)
                {
-                       strlcpy(u->oper,opertype.c_str(),NICKMAX);
+                       strlcpy(u->oper,opertype.c_str(),NICKMAX-1);
                        if (!strchr(u->modes,'o'))
                        {
                                strcat(u->modes,"o");
@@ -2295,6 +2295,16 @@ class TreeSocket : public InspSocket
                                }
                                else if (command == "PING")
                                {
+                                       /*
+                                        * We just got a ping from a server that's bursting.
+                                        * This can't be right, so set them to not bursting, and
+                                        * apply their lines.
+                                        */
+                                       if (this->bursting)
+                                       {
+                                               this->bursting = false;
+                                               apply_lines(APPLY_ZLINES|APPLY_GLINES|APPLY_QLINES);
+                                       }
                                        if (prefix == "")
                                        {
                                                prefix = this->GetName();
@@ -2303,6 +2313,16 @@ class TreeSocket : public InspSocket
                                }
                                else if (command == "PONG")
                                {
+                                       /*
+                                        * We just got a pong from a server that's bursting.
+                                        * This can't be right, so set them to not bursting, and
+                                        * apply their lines.
+                                        */
+                                       if (this->bursting)
+                                       {
+                                               this->bursting = false;
+                                               apply_lines(APPLY_ZLINES|APPLY_GLINES|APPLY_QLINES);
+                                       }
                                        if (prefix == "")
                                        {
                                                prefix = this->GetName();
@@ -2345,15 +2365,14 @@ class TreeSocket : public InspSocket
                                {
                                        return this->Time(prefix,params);
                                }
-                               else if (command == "KICK")
+                               else if ((command == "KICK") && (IsServer(prefix)))
                                {
                                        std::string sourceserv = this->myhost;
                                        if (params.size() == 3)
                                        {
-                                               userrec* source = Srv->FindNick(prefix);
                                                userrec* user = Srv->FindNick(params[1]);
                                                chanrec* chan = Srv->FindChannel(params[0]);
-                                               if (user && chan && !source)
+                                               if (user && chan)
                                                {
                                                        server_kick_channel(user,chan,(char*)params[2].c_str(),false);
                                                }