comparison 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
comparison
equal deleted inserted replaced
9029:697e169dac12 9030:7ab20f829190
16 * You should have received a copy of the GNU General Public License 16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 * 19 *
20 */ 20 */
21
22 #include "blist.h"
23
21 #include "internal.h" 24 #include "internal.h"
22 #include "debug.h" 25 #include "debug.h"
23 #include "ft.h" 26 #include "ft.h"
24 #include "network.h" 27 #include "network.h"
25 #include "notify.h" 28 #include "notify.h"
639 642
640 jabber_iq_send(iq); 643 jabber_iq_send(iq);
641 } 644 }
642 } 645 }
643 646
644 void jabber_si_xfer_ask_send(GaimConnection *gc, const char *name) 647 void jabber_si_xfer_ask_send(GaimBlistNode *node, gpointer data)
645 { 648 {
646 JabberStream *js = gc->proto_data; 649 GaimBuddy *buddy;
650 GaimConnection *gc;
651 JabberStream *js;
652
647 GaimXfer *xfer; 653 GaimXfer *xfer;
648 JabberSIXfer *jsx; 654 JabberSIXfer *jsx;
649 655
650 if(!gaim_find_buddy(gc->account, name) || !jabber_buddy_find(js, name, FALSE)) 656 g_return_if_fail(GAIM_BLIST_NODE_IS_BUDDY(node));
651 return; 657
652 658 buddy = (GaimBuddy *) node;
653 xfer = gaim_xfer_new(gaim_connection_get_account(gc), GAIM_XFER_SEND, name); 659 gc = gaim_account_get_connection(buddy->account);
660 js = gc->proto_data;
661
662 if(!gaim_find_buddy(gc->account, buddy->name) || !jabber_buddy_find(js, buddy->name, FALSE))
663 return;
664
665 xfer = gaim_xfer_new(buddy->account, GAIM_XFER_SEND, buddy->name);
654 666
655 xfer->data = jsx = g_new0(JabberSIXfer, 1); 667 xfer->data = jsx = g_new0(JabberSIXfer, 1);
656 jsx->js = js; 668 jsx->js = js;
657 669
658 gaim_xfer_set_init_fnc(xfer, jabber_si_xfer_init); 670 gaim_xfer_set_init_fnc(xfer, jabber_si_xfer_init);