libpurple/protocols/silc/wb.c

changeset 21453
a90cf329cd48
parent 21233
e75de8db4f2b
parent 20289
5c844288fbec
child 21630
591a79c1b295
--- a/libpurple/protocols/silc/wb.c	Sat Nov 10 01:18:15 2007 +0000
+++ b/libpurple/protocols/silc/wb.c	Sat Nov 10 04:52:20 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,7 +303,7 @@
 	req->channel = channel;
 	req->sg = sg;
 
-	purple_request_action_with_hint(gc, _("Whiteboard"), tmp, NULL, 1,
+	purple_request_action_with_hint(sender, _("Whiteboard"), tmp, NULL, 1,
 				sg->account, sender->nickname, NULL, PURPLE_REQUEST_UI_HINT_BLIST, req, 2,
 			    _("Yes"), G_CALLBACK(silcpurple_wb_request_cb),
 			    _("No"), G_CALLBACK(silcpurple_wb_request_cb));

mercurial