res->context = client;
res->sock = silc_socket_dup(conn->sock);
res->packet = silc_id_dup(client_id, SILC_ID_CLIENT);
- silc_schedule_task_add(client->schedule, 0,
+ silc_schedule_task_add(client->schedule, conn->sock->sock,
silc_client_notify_check_client, res,
(5 + (silc_rng_get_rn16(client->rng) % 29)),
0, SILC_TASK_TIMEOUT, SILC_TASK_PRI_NORMAL);
/* Find target Client entry */
client_entry2 =
silc_client_get_client_by_id(client, conn, client_id);
- if (!client_entry2)
+ if (!client_entry2) {
+ silc_client_notify_by_server_resolve(client, conn, packet,
+ SILC_ID_CLIENT, client_id);
goto out;
+ }
/* Get channel entry */
channel_id = silc_id_str2id(packet->dst_id, packet->dst_id_len,
goto out;
/* Replace the Channel ID */
- silc_client_replace_channel_id(client, conn, channel, channel_id);
+ if (silc_client_replace_channel_id(client, conn, channel, channel_id))
+ channel_id = NULL;
/* Notify application */
client->internal->ops->notify(client, conn, type, channel, channel);
silc_hash_table_del(channel->user_list, client_entry);
silc_free(chu);
}
+
+ if (!silc_hash_table_count(client_entry->channels)) {
+ SilcClientNotifyResolve res = silc_calloc(1, sizeof(*res));
+ res->context = client;
+ res->sock = silc_socket_dup(conn->sock);
+ res->packet = silc_id_dup(client_entry->id, SILC_ID_CLIENT);
+ silc_schedule_task_add(client->schedule, conn->sock->sock,
+ silc_client_notify_check_client, res,
+ (5 + (silc_rng_get_rn16(client->rng) % 529)),
+ 0, SILC_TASK_TIMEOUT, SILC_TASK_PRI_NORMAL);
+ }
}
break;
if (tmp && notify == SILC_NOTIFY_TYPE_NICK_CHANGE &&
!silc_hash_table_count(client_entry->channels))
silc_client_del_client(client, conn, client_entry);
+ else if (notify == SILC_NOTIFY_TYPE_SIGNOFF ||
+ notify == SILC_NOTIFY_TYPE_SERVER_SIGNOFF ||
+ notify == SILC_NOTIFY_TYPE_KILLED)
+ silc_client_del_client(client, conn, client_entry);
}
break;