-typedef struct {
- char *channel_name;
- char *nickname;
- char *username;
- char *hostname;
- SilcChannelEntry channel;
- SilcServer server;
- SilcClientEntry client;
-} JoinInternalContext;
-
-SILC_TASK_CALLBACK(silc_server_command_join_notify)
-{
- JoinInternalContext *ctx = (JoinInternalContext *)context;
-
- if (ctx->channel->key && ctx->channel->key_len) {
- SilcBuffer clidp;
-
- clidp = silc_id_payload_encode(ctx->client->id, SILC_ID_CLIENT);
-
- silc_server_send_notify_to_channel(ctx->server, ctx->channel, FALSE,
- SILC_NOTIFY_TYPE_JOIN, 1,
- clidp->data, clidp->len);
-#if 0
- /* Send NEW_CHANNEL_USER packet to primary route */
- silc_server_send_new_channel_user(server, server->router->connection,
- server->server_type == SILC_SERVER ?
- FALSE : TRUE,
- channel->id, SILC_ID_CHANNEL_LEN,
- client->id, SILC_ID_CLIENT_LEN);
-#endif
-
- /* Send USERS command reply to the joined channel so the user sees who
- is currently on the channel. */
- silc_server_command_send_users(ctx->server, ctx->client->connection,
- ctx->channel);
-
- silc_buffer_free(clidp);
- silc_free(ctx);
- } else {
- silc_task_register(ctx->server->timeout_queue, fd,
- silc_server_command_join_notify, context,
- 0, 200000, SILC_TASK_TIMEOUT, SILC_TASK_PRI_LOW);
- }
-}
-