- if (clients)
- silc_client_channel_message(client, conn->sock, packet);
- silc_packet_context_free(packet);
+ if (!silc_idcache_find_by_id_one(conn->channel_cache, res->channel_id,
+ &id_cache))
+ goto out;
+
+ channel = (SilcChannelEntry)id_cache->context;
+ message = silc_channel_message_get_data(res->payload, NULL);
+
+ /* Pass the message to application */
+ client->ops->channel_message(client, conn, clients[0], channel,
+ silc_channel_message_get_flags(res->payload),
+ message);
+ }
+
+ out:
+ silc_channel_message_payload_free(res->payload);
+ silc_free(res->channel_id);
+ silc_free(res);