char *nickname = NULL, *username = NULL;
char *realname = NULL;
unsigned int idle = 0, mode = 0;
+ SilcBuffer channels = NULL;
argc = silc_argument_get_arg_num(cmd->args);
return;
}
- tmp = silc_argument_get_arg_type(cmd->args, 7, &len);
+ tmp = silc_argument_get_arg_type(cmd->args, 6, &len);
if (tmp) {
- SILC_GET32_MSB(mode, tmp);
+ channels = silc_buffer_alloc(len);
+ silc_buffer_pull_tail(channels, SILC_BUFFER_END(channels));
+ silc_buffer_put(channels, tmp, len);
}
+ tmp = silc_argument_get_arg_type(cmd->args, 7, &len);
+ if (tmp)
+ SILC_GET32_MSB(mode, tmp);
+
tmp = silc_argument_get_arg_type(cmd->args, 8, &len);
- if (tmp) {
+ if (tmp)
SILC_GET32_MSB(idle, tmp);
- }
/* Check if we have this client cached already. */
if (!silc_idcache_find_by_id_one(conn->client_cache, (void *)client_id,
/* Notify application */
if (!cmd->callback)
COMMAND_REPLY((ARGS, client_entry, nickname, username, realname,
- NULL, mode, idle));
+ channels, mode, idle));
+
+ if (channels)
+ silc_buffer_free(channels);
}
/* Received reply for WHOIS command. This maybe called several times
/* Get channel mode */
tmp = silc_argument_get_arg_type(cmd->args, 5, NULL);
- if (tmp) {
+ if (tmp)
SILC_GET32_MSB(mode, tmp);
- } else {
+ else
mode = 0;
- }
/* Get channel key */
tmp = silc_argument_get_arg_type(cmd->args, 7, &len);