silc_free(client_id);
}
+ if (client_entry->status & SILC_CLIENT_STATUS_RESOLVING)
+ client_entry->status &= ~SILC_CLIENT_STATUS_RESOLVING;
+
/* Notify application */
if (!cmd->callback)
COMMAND_REPLY((ARGS, client_entry, nickname, username, realname,
name, info, NULL, 0);
}
+ if (client_entry->status & SILC_CLIENT_STATUS_RESOLVING)
+ client_entry->status &= ~SILC_CLIENT_STATUS_RESOLVING;
+
/* Notify application */
COMMAND_REPLY((ARGS, client_entry, name, info));
break;
/* Get topic */
topic = silc_argument_get_arg_type(cmd->args, 10, NULL);
+ /* If we have the channel entry, remove it and create a new one */
+ channel = silc_client_get_channel(cmd->client, conn, channel_name);
+ if (channel)
+ silc_client_del_channel(cmd->client, conn, channel);
+
/* Save received Channel ID. This actually creates the channel */
channel = silc_client_new_channel_id(cmd->client, cmd->sock, channel_name,
mode, idp);
SilcClientEntry client_entry;
SilcChannelEntry channel;
SilcChannelUser chu;
- unsigned char *tmp, *id;
+ unsigned char *modev, *tmp, *id;
uint32 len, mode;
SILC_GET16_MSB(status, silc_argument_get_arg_type(cmd->args, 1, NULL));
}
/* Get channel mode */
- tmp = silc_argument_get_arg_type(cmd->args, 2, NULL);
- if (!tmp) {
+ modev = silc_argument_get_arg_type(cmd->args, 2, NULL);
+ if (!modev) {
COMMAND_REPLY_ERROR;
goto out;
}
client_entry = (SilcClientEntry)id_cache->context;
/* Save the mode */
- SILC_GET32_MSB(mode, tmp);
+ SILC_GET32_MSB(mode, modev);
+ silc_list_start(channel->clients);
while ((chu = silc_list_get(channel->clients)) != SILC_LIST_END) {
if (chu->client == client_entry) {
chu->mode = mode;
if (!id_cache || !((SilcClientEntry)id_cache->context)->username ||
!((SilcClientEntry)id_cache->context)->realname) {
+
+ if (id_cache && id_cache->context) {
+ SilcClientEntry client_entry = (SilcClientEntry)id_cache->context;
+ if (client_entry->status & SILC_CLIENT_STATUS_RESOLVING) {
+ client_entry->status &= ~SILC_CLIENT_STATUS_RESOLVING;
+ silc_buffer_pull(client_id_list, idp_len);
+ silc_buffer_pull(client_mode_list, 4);
+ continue;
+ }
+ client_entry->status |= SILC_CLIENT_STATUS_RESOLVING;
+ }
+
/* No we don't have it (or it is incomplete in information), query
it from the server. Assemble argument table that will be sent
for the WHOIS command later. */