SILC_LOG_DEBUG(("Moving client to local list"));
silc_idcache_add(server->local_list->clients, client_cache->name,
client_cache->id, client_cache->context,
- client_cache->expire);
+ client_cache->expire, NULL);
silc_idcache_del_by_context(server->global_list->clients, client);
}
server_entry = server_entry->router;
SILC_LOG_DEBUG(("Moving client to local list"));
silc_idcache_add(server->local_list->clients, client_cache->name,
client_cache->id, client_cache->context,
- client_cache->expire);
+ client_cache->expire, NULL);
silc_idcache_del_by_context(server->global_list->clients, client);
}
}
SILC_LOG_DEBUG(("Moving client to global list"));
silc_idcache_add(server->global_list->clients, client_cache->name,
client_cache->id, client_cache->context,
- client_cache->expire);
+ client_cache->expire, NULL);
silc_idcache_del_by_context(server->local_list->clients, client);
}
server_entry = server_entry->router;
SILC_LOG_DEBUG(("Moving client to global list"));
silc_idcache_add(server->global_list->clients, client_cache->name,
client_cache->id, client_cache->context,
- client_cache->expire);
+ client_cache->expire, NULL);
silc_idcache_del_by_context(server->local_list->clients, client);
}
}
}
}
+/* Removes channels that are from `from. */
+
+void silc_server_remove_channels_by_server(SilcServer server,
+ SilcServerEntry from)
+{
+ SilcIDCacheList list = NULL;
+ SilcIDCacheEntry id_cache = NULL;
+ SilcChannelEntry channel = NULL;
+
+ SILC_LOG_DEBUG(("Start"));
+
+ if (silc_idcache_get_all(server->global_list->channels, &list)) {
+ if (silc_idcache_list_first(list, &id_cache)) {
+ while (id_cache) {
+ channel = (SilcChannelEntry)id_cache->context;
+ if (channel->router == from)
+ silc_idlist_del_channel(server->global_list, channel);
+ if (!silc_idcache_list_next(list, &id_cache))
+ break;
+ }
+ }
+ silc_idcache_list_free(list);
+ }
+}
+
+/* Updates channels that are from `from' to be originated from `to'. */
+
+void silc_server_update_channels_by_server(SilcServer server,
+ SilcServerEntry from,
+ SilcServerEntry to)
+{
+ SilcIDCacheList list = NULL;
+ SilcIDCacheEntry id_cache = NULL;
+ SilcChannelEntry channel = NULL;
+
+ SILC_LOG_DEBUG(("Start"));
+
+ if (silc_idcache_get_all(server->global_list->channels, &list)) {
+ if (silc_idcache_list_first(list, &id_cache)) {
+ while (id_cache) {
+ channel = (SilcChannelEntry)id_cache->context;
+ if (channel->router == from)
+ channel->router = to;
+ if (!silc_idcache_list_next(list, &id_cache))
+ break;
+ }
+ }
+ silc_idcache_list_free(list);
+ }
+}
+
/* Checks whether given channel has global users. If it does this returns
TRUE and FALSE if there is only locally connected clients on the channel. */