+ silc_free(client_id);
+
+ /* If target is founder they cannot be kicked */
+ if (!silc_server_client_on_channel(client, channel, &chl))
+ goto out;
+ if (chl->mode & SILC_CHANNEL_UMODE_CHANFO)
+ goto out;
+
+ /* Get kicker. In protocol version 1.0 this is not mandatory argument
+ so we check it only if it is provided. */
+ tmp = silc_argument_get_arg_type(args, 3, &tmp_len);
+ if (tmp) {
+ client_id = silc_id_payload_parse_id(tmp, tmp_len, NULL);
+ if (!client_id)
+ goto out;
+
+ /* If the the client is not in local list we check global list */
+ client2 = silc_idlist_find_client_by_id(server->global_list,
+ client_id, TRUE, NULL);
+ if (!client2) {
+ client = silc_idlist_find_client_by_id(server->local_list,
+ client_id, TRUE, NULL);
+ if (!client2) {
+ silc_free(client_id);
+ goto out;
+ }
+ }
+ silc_free(client_id);
+
+ /* Kicker must be operator on channel */
+ if (!silc_server_client_on_channel(client2, channel, &chl))
+ goto out;
+ if (chl->mode == SILC_CHANNEL_UMODE_NONE)
+ goto out;
+ }