X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcclient%2Fclient_channel.c;h=3b020c5daa90ce030646805f13ed52694d07f9ac;hb=7ba30123577540d59575c8f020bad86c52c21f59;hp=4120695d76af08286853fa5fc5bdf31f0f767220;hpb=d0c0355c2fa9ef0aa699010242479366c06b7041;p=silc.git diff --git a/lib/silcclient/client_channel.c b/lib/silcclient/client_channel.c index 4120695d..3b020c5d 100644 --- a/lib/silcclient/client_channel.c +++ b/lib/silcclient/client_channel.c @@ -53,9 +53,12 @@ SilcBool silc_client_send_channel_message(SilcClient client, chu = silc_client_on_channel(channel, conn->local_entry); if (silc_unlikely(!chu)) { + conn->context_type = SILC_ID_CHANNEL; + conn->channel_entry = channel; client->internal->ops->say(conn->client, conn, - SILC_CLIENT_MESSAGE_AUDIT, + SILC_CLIENT_MESSAGE_ERROR, "Cannot talk to channel: not joined"); + conn->context_type = SILC_ID_NONE; return FALSE; } @@ -423,21 +426,27 @@ SilcBool silc_client_save_channel_key(SilcClient client, /* Get channel cipher */ cipher = silc_channel_key_get_cipher(payload, NULL); if (!silc_cipher_alloc(cipher, &channel->internal.send_key)) { + conn->context_type = SILC_ID_CHANNEL; + conn->channel_entry = channel; client->internal->ops->say( conn->client, conn, - SILC_CLIENT_MESSAGE_AUDIT, + SILC_CLIENT_MESSAGE_ERROR, "Cannot talk to channel: unsupported cipher %s", cipher); + conn->context_type = SILC_ID_NONE; silc_client_unref_channel(client, conn, channel); silc_channel_key_payload_free(payload); return FALSE; } if (!silc_cipher_alloc(cipher, &channel->internal.receive_key)) { + conn->context_type = SILC_ID_CHANNEL; + conn->channel_entry = channel; client->internal->ops->say( conn->client, conn, - SILC_CLIENT_MESSAGE_AUDIT, + SILC_CLIENT_MESSAGE_ERROR, "Cannot talk to channel: unsupported cipher %s", cipher); + conn->context_type = SILC_ID_NONE; silc_client_unref_channel(client, conn, channel); silc_channel_key_payload_free(payload); return FALSE; @@ -453,11 +462,14 @@ SilcBool silc_client_save_channel_key(SilcClient client, (char *)silc_hmac_get_name(channel->internal.hmac) : SILC_DEFAULT_HMAC); if (!silc_hmac_alloc(hmac, NULL, &channel->internal.hmac)) { + conn->context_type = SILC_ID_CHANNEL; + conn->channel_entry = channel; client->internal->ops->say( conn->client, conn, - SILC_CLIENT_MESSAGE_AUDIT, + SILC_CLIENT_MESSAGE_ERROR, "Cannot talk to channel: unsupported HMAC %s", hmac); + conn->context_type = SILC_ID_NONE; silc_client_unref_channel(client, conn, channel); silc_channel_key_payload_free(payload); return FALSE;