]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc-info.c
accoring to comments in the code, MaxConnections, MaxConnectionsIP and MaxJoins
[ngircd-alex.git] / src / ngircd / irc-info.c
index 62b238eeabaa2b567c9f94fc316a208eaa823790..a63e3aa7ad45971b3ff86f9f0c09945e3efe5230 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: irc-info.c,v 1.34 2006/09/16 12:22:09 fw Exp $";
+static char UNUSED id[] = "$Id: irc-info.c,v 1.38 2007/10/04 15:03:56 alex Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -542,7 +542,8 @@ GLOBAL bool
 IRC_WHO( CLIENT *Client, REQUEST *Req )
 {
        bool ok, only_ops;
-       char flags[8], *ptr;
+       char flags[8];
+       const char *ptr;
        CL2CHAN *cl2chan;
        CHANNEL *chan, *cn;
        CLIENT *c;
@@ -706,10 +707,13 @@ IRC_WHOIS( CLIENT *Client, REQUEST *Req )
                if( ! IRC_WriteStrClient( from, RPL_WHOISOPERATOR_MSG, Client_ID( from ), Client_ID( c ))) return DISCONNECTED;
        }
 
-       /* Idle (only local clients) */
-       if( Client_Conn( c ) > NONE )
-       {
-               if( ! IRC_WriteStrClient( from, RPL_WHOISIDLE_MSG, Client_ID( from ), Client_ID( c ), Conn_GetIdle( Client_Conn ( c )))) return DISCONNECTED;
+       /* Idle and signon time (local clients only!) */
+       if (Client_Conn(c) > NONE ) {
+               if (! IRC_WriteStrClient(from, RPL_WHOISIDLE_MSG,
+                       Client_ID(from), Client_ID(c),
+                       (unsigned long)Conn_GetIdle(Client_Conn(c)),
+                       (unsigned long)Conn_GetSignon(Client_Conn(c))))
+                               return DISCONNECTED;
        }
 
        /* Away? */
@@ -832,7 +836,10 @@ IRC_WHOWAS( CLIENT *Client, REQUEST *Req )
 GLOBAL bool
 IRC_Send_LUSERS( CLIENT *Client )
 {
-       long cnt;
+       unsigned long cnt;
+#ifndef STRICT_RFC
+       unsigned long max;
+#endif
 
        assert( Client != NULL );
 
@@ -861,9 +868,17 @@ IRC_Send_LUSERS( CLIENT *Client )
 
 #ifndef STRICT_RFC
        /* Maximum number of local users */
-       if( ! IRC_WriteStrClient( Client, RPL_LOCALUSERS_MSG, Client_ID( Client ), Client_MyUserCount( ), Client_MyMaxUserCount( ))) return DISCONNECTED;
+       cnt = Client_MyUserCount();
+       max = Client_MyMaxUserCount();
+       if (! IRC_WriteStrClient(Client, RPL_LOCALUSERS_MSG, Client_ID(Client),
+                       cnt, max, cnt, max))
+               return DISCONNECTED;
        /* Maximum number of users in the network */
-       if( ! IRC_WriteStrClient( Client, RPL_NETUSERS_MSG, Client_ID( Client ), Client_UserCount( ), Client_MaxUserCount( ))) return DISCONNECTED;
+       cnt = Client_UserCount();
+       max = Client_MaxUserCount();
+       if(! IRC_WriteStrClient(Client, RPL_NETUSERS_MSG, Client_ID(Client),
+                       cnt, max, cnt, max))
+               return DISCONNECTED;
 #endif
        
        return CONNECTED;