X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fusers.cpp;h=4c7173e30084daa670450695e27d0367ebf03640;hb=64f837e0d3fb6f9d495e5a9e2930a9d76dc3748c;hp=b179fabddf7f11ccdb20e8063b2ae9aefe8cb765;hpb=8f282762b0a90458a808e13c4a52196ebd14534a;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/users.cpp b/src/users.cpp index b179fabdd..4c7173e30 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -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,""); @@ -32,6 +33,7 @@ userrec::userrec() invites.clear(); } + char* userrec::GetFullHost() { @@ -50,11 +52,14 @@ bool userrec::IsInvited(char* channel) { for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++) { - if (!strcasecmp(i->channel,channel)) - { - return true; + if (i->channel) { + if (!strcasecmp(i->channel,channel)) + { + return true; + } } } + return false; } void userrec::InviteTo(char* channel) @@ -66,12 +71,18 @@ void userrec::InviteTo(char* channel) void userrec::RemoveInvite(char* channel) { - for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++) - { - 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; + } + } + } } }