* therefore answers with ERR_SUMMONDISABLED.
*/
GLOBAL bool
-IRC_SUMMON(CLIENT * Client, REQUEST * Req)
+IRC_SUMMON(CLIENT * Client, UNUSED REQUEST * Req)
{
return IRC_WriteStrClient(Client, ERR_SUMMONDISABLED_MSG,
- Client_ID(Client), Req->command);
+ Client_ID(Client));
} /* IRC_SUMMON */
* See RFC 2812 section 4.6. As suggested there the command is disabled.
*/
GLOBAL bool
-IRC_USERS(CLIENT * Client, REQUEST * Req)
+IRC_USERS(CLIENT * Client, UNUSED REQUEST * Req)
{
return IRC_WriteStrClient(Client, ERR_USERSDISABLED_MSG,
- Client_ID(Client), Req->command);
+ Client_ID(Client));
} /* IRC_USERS */
/**
* Generate WHOIS reply of one actual client.
*
- * @param Client The client from which this command has been received.
- * @param from The client requesting the information ("originator").
- * @param c The client of which information should be returned.
- * @returns CONNECTED or DISCONNECTED.
+ * @param Client The client from which this command has been received.
+ * @param from The client requesting the information ("originator").
+ * @param c The client of which information should be returned.
+ * @return CONNECTED or DISCONNECTED.
*/
static bool
IRC_WHOIS_SendReply(CLIENT *Client, CLIENT *from, CLIENT *c)
CL2CHAN *cl2chan;
CHANNEL *chan;
+ assert(Client != NULL);
+ assert(from != NULL);
+ assert(c != NULL);
+
/* Nick, user, hostname and client info */
if (!IRC_WriteStrClient(from, RPL_WHOISUSER_MSG, Client_ID(from),
Client_ID(c), Client_User(c),
/* IRC-Operator? */
if (Client_HasMode(c, 'o') &&
- !IRC_WriteStrClient(from, RPL_WHOISOPERATOR_MSG,
- Client_ID(from), Client_ID(c)))
- return DISCONNECTED;
+ !IRC_WriteStrClient(from, RPL_WHOISOPERATOR_MSG,
+ Client_ID(from), Client_ID(c)))
+ return DISCONNECTED;
/* Connected using SSL? */
if (Conn_UsesSSL(Client_Conn(c)) &&
- !IRC_WriteStrClient(from, RPL_WHOISSSL_MSG,
- Client_ID(from), Client_ID(c)))
- return DISCONNECTED;
+ !IRC_WriteStrClient(from, RPL_WHOISSSL_MSG, Client_ID(from),
+ Client_ID(c)))
+ return DISCONNECTED;
+
+ /* Registered nick name? */
+ if (Client_HasMode(c, 'R') &&
+ !IRC_WriteStrClient(from, RPL_WHOISREGNICK_MSG,
+ Client_ID(from), Client_ID(c)))
+ return DISCONNECTED;
+
+ if (Client_Conn(c) > NONE && (Client_OperByMe(from) || from == c) &&
+ !IRC_WriteStrClient(from, RPL_WHOISHOST_MSG, Client_ID(from),
+ Client_ID(c), Client_Hostname(c),
+ Conn_GetIPAInfo(Client_Conn(c))))
+ return DISCONNECTED;
/* Idle and signon time (local clients only!) */
if (!Conf_MorePrivacy && Client_Conn(c) > NONE &&
- !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;
+ !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? */
if (Client_HasMode(c, 'a') &&
- !IRC_WriteStrClient(from, RPL_AWAY_MSG,
- Client_ID(from), Client_ID(c),
- Client_Away(c)))
- return DISCONNECTED;
+ !IRC_WriteStrClient(from, RPL_AWAY_MSG,
+ Client_ID(from), Client_ID(c), Client_Away(c)))
+ return DISCONNECTED;
return CONNECTED;
} /* IRC_WHOIS_SendReply */
return IRC_WriteStrClient(Client, RPL_ISUPPORT2_MSG, Client_ID(Client),
CHANNEL_NAME_LEN - 1, Conf_MaxNickLength - 1,
COMMAND_LEN - 23, CLIENT_AWAY_LEN - 1,
- COMMAND_LEN - 113, MAX_HNDL_MODES_ARG);
+ COMMAND_LEN - 113, MAX_HNDL_MODES_ARG,
+ MAX_HNDL_CHANNEL_LISTS);
} /* IRC_Send_ISUPPORT */