- client = silc_idlist_find_client_by_id(server->global_list,
- client_id, TRUE, &cache);
- if (!client) {
- client = silc_idlist_find_client_by_id(server->local_list,
+ if (id_type == SILC_ID_CLIENT) {
+ client = silc_idlist_find_client_by_id(server->global_list,
- /* Get user's channel entry and check that topic set is allowed. */
- if (!silc_server_client_on_channel(client, channel, &chl))
- goto out;
- if (channel->mode & SILC_CHANNEL_MODE_TOPIC &&
- !(chl->mode & SILC_CHANNEL_UMODE_CHANOP) &&
- !(chl->mode & SILC_CHANNEL_UMODE_CHANFO)) {
- SILC_LOG_DEBUG(("Topic change is not allowed"));
- goto out;
+ if (client) {
+ /* Get user's channel entry and check that topic set is allowed. */
+ if (!silc_server_client_on_channel(client, channel, &chl))
+ goto out;
+ if (channel->mode & SILC_CHANNEL_MODE_TOPIC &&
+ !(chl->mode & SILC_CHANNEL_UMODE_CHANOP) &&
+ !(chl->mode & SILC_CHANNEL_UMODE_CHANFO)) {
+ SILC_LOG_DEBUG(("Topic change is not allowed"));
+ goto out;
+ }
silc_server_send_notify_topic_set(server, sock,
server->server_type == SILC_ROUTER ?
TRUE : FALSE, channel,
silc_server_send_notify_topic_set(server, sock,
server->server_type == SILC_ROUTER ?
TRUE : FALSE, channel,
SILC_LOG_DEBUG(("Forcing the server to change Channel ID"));
silc_server_send_notify_channel_change(server, sock, FALSE,
channel_id, channel->id);
SILC_LOG_DEBUG(("Forcing the server to change Channel ID"));
silc_server_send_notify_channel_change(server, sock, FALSE,
channel_id, channel->id);
/* If the mode is different from what we have then enforce the
mode change. */
mode = silc_channel_get_mode(payload);
/* If the mode is different from what we have then enforce the
mode change. */
mode = silc_channel_get_mode(payload);
/* Create new key for the channel and send it to the server and
everybody else possibly on the channel. */
/* Create new key for the channel and send it to the server and
everybody else possibly on the channel. */
users_modes->len, FALSE);
silc_buffer_free(users_modes);
}
users_modes->len, FALSE);
silc_buffer_free(users_modes);
}
+ if (channel->topic) {
+ silc_server_send_notify_topic_set(server, sock,
+ server->server_type == SILC_ROUTER ?
+ TRUE : FALSE, channel,
+ server->id, SILC_ID_SERVER,
+ channel->topic);
+ }