]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc-info.c
Code cleanup: mostly removing empty lines
[ngircd-alex.git] / src / ngircd / irc-info.c
index 905799eb52fc21886bec08a44e4c88553d2ef7b0..46e342711387269a1cc47d19ecf1e1dee870c388 100644 (file)
@@ -7,13 +7,15 @@
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  * Please read the file COPYING, README and AUTHORS for more information.
- *
- * IRC info commands
  */
 
-
 #include "portab.h"
 
+/**
+ * @file
+ * IRC info commands
+ */
+
 #include "imp.h"
 #include <assert.h>
 #include <errno.h>
@@ -914,6 +916,15 @@ IRC_WHO( CLIENT *Client, REQUEST *Req )
 } /* IRC_WHO */
 
 
+/**
+ * Handler for the IRC "WHOIS" command.
+ *
+ * See RFC 2812, 3.6.2 "Whois query".
+ *
+ * @param Client       The client from which this command has been received.
+ * @param Req          Request structure with prefix and all parameters.
+ * @return             CONNECTED or DISCONNECTED.
+ */
 GLOBAL bool
 IRC_WHOIS( CLIENT *Client, REQUEST *Req )
 {
@@ -926,11 +937,17 @@ IRC_WHOIS( CLIENT *Client, REQUEST *Req )
        assert( Req != NULL );
 
        /* Bad number of parameters? */
-       if(( Req->argc < 1 ) || ( Req->argc > 2 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
+       if (Req->argc < 1 || Req->argc > 2)
+               return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
+                                         Client_ID(Client), Req->command);
 
        /* Search client */
-       c = Client_Search( Req->argv[Req->argc - 1] );
-       if(( ! c ) || ( Client_Type( c ) != CLIENT_USER )) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->argv[Req->argc - 1] );
+       c = Client_Search(Req->argv[Req->argc - 1]);
+       if (!c || (Client_Type(c) != CLIENT_USER
+                  && Client_Type(c) != CLIENT_SERVICE))
+               return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG,
+                                         Client_ID(Client),
+                                         Req->argv[Req->argc - 1]);
 
        /* Search sender of the WHOIS */
        if( Client_Type( Client ) == CLIENT_SERVER ) from = Client_Search( Req->prefix );
@@ -1239,7 +1256,9 @@ static bool Show_MOTD_SSLInfo(CLIENT *Client)
        return ret;
 }
 #else
-static inline bool Show_MOTD_SSLInfo(UNUSED CLIENT *c) { return true; }
+static inline bool
+Show_MOTD_SSLInfo(UNUSED CLIENT *c)
+{ return true; }
 #endif
 
 GLOBAL bool
@@ -1337,7 +1356,7 @@ IRC_Send_NAMES( CLIENT *Client, CHANNEL *Chan )
  * See <http://www.irc.org/tech_docs/005.html> for details.
  */
 GLOBAL bool
-IRC_Send_ISUPPORT PARAMS((CLIENT * Client))
+IRC_Send_ISUPPORT(CLIENT * Client)
 {
        if (!IRC_WriteStrClient(Client, RPL_ISUPPORT1_MSG, Client_ID(Client),
                                Conf_MaxJoins))