]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
Fix all typos (not as fun as 'kill all humans' but meh, beggers cant be choosers)
[user/henk/code/inspircd.git] / src / users.cpp
index 249b789e9d83c552b6ef616a470aaa4c49e9f232..f51656a55f388e791ced3d559dc10e90da79871d 100644 (file)
@@ -110,20 +110,44 @@ bool DoneClassesAndTypes(const char* tag)
        return true;
 }
 
+bool userrec::IsModeSet(unsigned char m)
+{
+       return (modes[m-65]);
+}
+
+void userrec::SetMode(unsigned char m, bool value)
+{
+       modes[m-65] = value;
+}
+
+const char* userrec::FormatModes()
+{
+       static char data[MAXBUF];
+       int offset = 0;
+       for (int n = 0; n < 64; n++)
+       {
+               if (modes[n])
+                       data[offset++] = n+65;
+       }
+       data[offset] = 0;
+       return data;
+}
+
 userrec::userrec()
 {
        // the PROPER way to do it, AVOID bzero at *ALL* costs
-       *password = *nick = *ident = *host = *dhost = *fullname = *modes = *awaymsg = *oper = 0;
+       *password = *nick = *ident = *host = *dhost = *fullname = *awaymsg = *oper = 0;
        server = (char*)FindServerNamePtr(Config->ServerName);
        reset_due = TIME;
        lines_in = fd = lastping = signon = idle_lastmsg = nping = registered = 0;
-       modebits = timeout = flood = port = bytes_in = bytes_out = cmds_in = cmds_out = 0;
+       timeout = flood = port = bytes_in = bytes_out = cmds_in = cmds_out = 0;
        haspassed = dns_done = false;
        recvq = "";
        sendq = "";
        chans.clear();
        invites.clear();
        chans.resize(MAXCHANS);
+       memset(modes,0,sizeof(modes));
        
        for (unsigned int n = 0; n < MAXCHANS; n++)
        {
@@ -481,7 +505,7 @@ void kill_link(userrec *user,const char* r)
        char reason[MAXBUF];
 
        strlcpy(reason,r,MAXQUIT-1);
-       log(DEBUG,"kill_link: %s '%s'",user->nick,reason);
+       log(DEBUG,"kill_link: %s %d '%s'",user->nick,user->fd,reason);
        
        if (IS_LOCAL(user))
                Write(user->fd,"ERROR :Closing link (%s@%s) [%s]",user->ident,user->host,reason);
@@ -811,7 +835,7 @@ void FullConnectUser(userrec* user, CullList* Goners)
                        return;
                }
                
-               r = matches_kline(user->host);
+               r = matches_kline(match_against);
                
                if (r)
                {