]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
Fix for bug ID #5 (PING, PONG And other matters)
[user/henk/code/inspircd.git] / src / users.cpp
index 4a9ada90dc9ba0edbf239d39fc81e5f2831e1432..3211a029f6c2c8c3919a6841b38cdaa8f930f909 100644 (file)
@@ -13,6 +13,7 @@ userrec::userrec()
        // the PROPER way to do it, AVOID bzero at *ALL* costs
        strcpy(nick,"");
        ip = 0;
+       timeout = 0;
        strcpy(ident,"");
        strcpy(host,"");
        strcpy(dhost,"");
@@ -69,14 +70,18 @@ void userrec::InviteTo(char* channel)
 
 void userrec::RemoveInvite(char* channel)
 {
-        for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++)
-        {
-               if (i->channel) {
-                       if (!strcasecmp(i->channel,channel))
-                       {
-                                       invites.erase(i);
-                               return;
-                       }
-                }
+       log(DEBUG,"Removing invites");
+       if (invites.size())
+       {
+               for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++)
+               {
+                       if (i->channel) {
+                               if (!strcasecmp(i->channel,channel))
+                               {
+                                               invites.erase(i);
+                                       return;
+                               }
+                       }
+               }
         }
 }