Mercurial > pidgin
diff libpurple/protocols/silc/wb.c @ 21044:6b02dba5bf41
Patch from Pekka Riikone to fix various SILC issues.
Fixes: #3103
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Mon, 29 Oct 2007 00:19:53 +0000 |
parents | 980a104267da |
children | 6de09629f091 |
line wrap: on
line diff
--- a/libpurple/protocols/silc/wb.c Mon Oct 29 00:09:18 2007 +0000 +++ b/libpurple/protocols/silc/wb.c Mon Oct 29 00:19:53 2007 +0000 @@ -254,10 +254,10 @@ static void silcpurple_wb_request(SilcClient client, const unsigned char *message, - SilcUInt32 message_len, SilcClientEntry sender, - SilcChannelEntry channel) + SilcUInt32 message_len, SilcClientEntry sender, + SilcChannelEntry channel) { - char tmp[128]; + char tmp[256]; SilcPurpleWbRequest req; PurpleConnection *gc; SilcPurple sg; @@ -274,20 +274,24 @@ else wb = silcpurple_wb_init_ch(sg, channel); - silcpurple_wb_parse(wb->proto_data, wb, (unsigned char *)message, - message_len); + silcpurple_wb_parse(wb->proto_data, wb, + (unsigned char *)message, + message_len); return; } + /* Close any previous unaccepted requests */ + purple_request_close_with_handle(sender); + if (!channel) { g_snprintf(tmp, sizeof(tmp), - _("%s sent message to whiteboard. Would you like " - "to open the whiteboard?"), sender->nickname); + _("%s sent message to whiteboard. Would you like " + "to open the whiteboard?"), sender->nickname); } else { g_snprintf(tmp, sizeof(tmp), - _("%s sent message to whiteboard on %s channel. " - "Would you like to open the whiteboard?"), - sender->nickname, channel->channel_name); + _("%s sent message to whiteboard on %s channel. " + "Would you like to open the whiteboard?"), + sender->nickname, channel->channel_name); } req = silc_calloc(1, sizeof(*req)); @@ -299,10 +303,10 @@ req->channel = channel; req->sg = sg; - purple_request_action(gc, _("Whiteboard"), tmp, NULL, 1, - sg->account, sender->nickname, NULL, req, 2, - _("Yes"), G_CALLBACK(silcpurple_wb_request_cb), - _("No"), G_CALLBACK(silcpurple_wb_request_cb)); + purple_request_action(sender, _("Whiteboard"), tmp, NULL, 1, + sg->account, sender->nickname, NULL, req, 2, + _("Yes"), G_CALLBACK(silcpurple_wb_request_cb), + _("No"), G_CALLBACK(silcpurple_wb_request_cb)); } /* Process incoming whiteboard message */