updates.
[silc.git] / apps / silcd / server_util.c
index 2a7cb7a74a36de7c7b6912b76c96000ce5df82e6..ea53991371ac1606f17f8c5eb89362a4ae0a617d 100644 (file)
@@ -194,10 +194,9 @@ bool silc_server_remove_clients_by_server(SilcServer server,
          client->data.status &= ~SILC_IDLIST_STATUS_REGISTERED;
          id_cache->expire = SILC_ID_CACHE_EXPIRE_DEF;
        } else {
-         silc_idlist_del_client(server->local_list, client);
-
          /* Remove this client from watcher list if it is */
          silc_server_del_from_watcher_list(server, client);
+         silc_idlist_del_client(server->local_list, client);
        }
 
        if (!silc_idcache_list_next(list, &id_cache))
@@ -1019,6 +1018,10 @@ bool silc_server_check_cmode_rights(SilcServer server,
   if (is_op && is_fo)
     return TRUE;
 
+  /* Founder emplies operator */
+  if (is_fo)
+    is_op = TRUE;
+
   /* We know that client is channel operator, check that they are not
      changing anything that requires channel founder rights. Rest of the
      modes are available automatically for channel operator. */
@@ -1208,6 +1211,9 @@ void silc_server_kill_client(SilcServer server,
 {
   SilcBuffer killed, killer;
 
+  SILC_LOG_DEBUG(("Killing client %s", 
+                 silc_id_render(remote_client->id, SILC_ID_CLIENT)));
+
   /* Send the KILL notify packets. First send it to the channel, then
      to our primary router and then directly to the client who is being
      killed right now. */
@@ -1263,7 +1269,6 @@ void silc_server_kill_client(SilcServer server,
     if (!silc_idlist_del_client(server->global_list, remote_client)) {
       /* Remove this client from watcher list if it is */
       silc_server_del_from_watcher_list(server, remote_client);
-
       silc_idlist_del_client(server->local_list, remote_client);  
     }
   }
@@ -1390,9 +1395,11 @@ bool silc_server_force_cumode_change(SilcServer server,
   SilcBuffer idp1, idp2;
   unsigned char cumode[4];
 
+  SILC_LOG_DEBUG(("Start"));
+
   silc_server_send_notify_cumode(server, sock, FALSE, channel, forced_mode,
                                 server->id, SILC_ID_SERVER,
-                                chl->client->id);
+                                chl->client->id, NULL);
 
   idp1 = silc_id_payload_encode(server->id, SILC_ID_SERVER);
   idp2 = silc_id_payload_encode(chl->client->id, SILC_ID_CLIENT);
@@ -1404,4 +1411,6 @@ bool silc_server_force_cumode_change(SilcServer server,
                                     idp2->data, idp2->len);
   silc_buffer_free(idp1);
   silc_buffer_free(idp2);
+
+  return TRUE;
 }