diff src/protocols/jabber/si.c @ 9030:7ab20f829190

[gaim-migrate @ 9806] Siege updated the code for creating right-click menu's for buddies, chats, groups, etc. It uses more stuff from the blist API and less stuff from multi.h. It also combines the code for right-click menus for chats, buddies, etc. (all types of blist nodes). So PRPLs and plugins can easily add right-click menu options to anything in the buddy list in a clean way. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 23 May 2004 17:27:45 +0000
parents 518455386538
children d27156c9c876
line wrap: on
line diff
--- a/src/protocols/jabber/si.c	Sun May 23 08:06:38 2004 +0000
+++ b/src/protocols/jabber/si.c	Sun May 23 17:27:45 2004 +0000
@@ -18,6 +18,9 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  */
+
+#include "blist.h"
+
 #include "internal.h"
 #include "debug.h"
 #include "ft.h"
@@ -641,16 +644,25 @@
 	}
 }
 
-void jabber_si_xfer_ask_send(GaimConnection *gc, const char *name)
+void jabber_si_xfer_ask_send(GaimBlistNode *node, gpointer data)
 {
-	JabberStream *js = gc->proto_data;
+	GaimBuddy *buddy;
+	GaimConnection *gc;
+	JabberStream *js;
+
 	GaimXfer *xfer;
 	JabberSIXfer *jsx;
 
-	if(!gaim_find_buddy(gc->account, name) || !jabber_buddy_find(js, name, FALSE))
+	g_return_if_fail(GAIM_BLIST_NODE_IS_BUDDY(node));
+
+	buddy = (GaimBuddy *) node;
+	gc = gaim_account_get_connection(buddy->account);
+	js = gc->proto_data;
+
+	if(!gaim_find_buddy(gc->account, buddy->name) || !jabber_buddy_find(js, buddy->name, FALSE))
 		return;
 
-	xfer = gaim_xfer_new(gaim_connection_get_account(gc), GAIM_XFER_SEND, name);
+	xfer = gaim_xfer_new(buddy->account, GAIM_XFER_SEND, buddy->name);
 
 	xfer->data = jsx = g_new0(JabberSIXfer, 1);
 	jsx->js = js;