comparison pidgin/gtkconv.c @ 32708:10e5000326a5

Convert code to use the purple_account accessor functions.
author andrew.victor@mxit.com
date Sat, 01 Oct 2011 21:04:35 +0000
parents 588f9b808a31
children 512d781a5849
comparison
equal deleted inserted replaced
32707:f75041cb3fec 32708:10e5000326a5
1744 gtk_widget_set_sensitive(button, FALSE); 1744 gtk_widget_set_sensitive(button, FALSE);
1745 1745
1746 if (buddy != NULL) 1746 if (buddy != NULL)
1747 { 1747 {
1748 if (purple_account_is_connected(account)) 1748 if (purple_account_is_connected(account))
1749 pidgin_append_blist_node_proto_menu(menu, account->gc, 1749 pidgin_append_blist_node_proto_menu(menu, purple_account_get_connection(account),
1750 (PurpleBlistNode *)buddy); 1750 (PurpleBlistNode *)buddy);
1751 pidgin_append_blist_node_extended_menu(menu, (PurpleBlistNode *)buddy); 1751 pidgin_append_blist_node_extended_menu(menu, (PurpleBlistNode *)buddy);
1752 gtk_widget_show_all(menu); 1752 gtk_widget_show_all(menu);
1753 } 1753 }
1754 1754
1770 gchar *who; 1770 gchar *who;
1771 1771
1772 gtkconv = PIDGIN_CONVERSATION(conv); 1772 gtkconv = PIDGIN_CONVERSATION(conv);
1773 gtkchat = gtkconv->u.chat; 1773 gtkchat = gtkconv->u.chat;
1774 account = purple_conversation_get_account(conv); 1774 account = purple_conversation_get_account(conv);
1775 gc = account->gc; 1775 gc = purple_account_get_connection(account);
1776 1776
1777 model = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkchat->list)); 1777 model = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkchat->list));
1778 1778
1779 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(gtkchat->list)); 1779 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(gtkchat->list));
1780 if(!gtk_tree_selection_get_selected(sel, NULL, &iter)) 1780 if(!gtk_tree_selection_get_selected(sel, NULL, &iter))
1806 gchar *who; 1806 gchar *who;
1807 int x, y; 1807 int x, y;
1808 1808
1809 gtkchat = gtkconv->u.chat; 1809 gtkchat = gtkconv->u.chat;
1810 account = purple_conversation_get_account(conv); 1810 account = purple_conversation_get_account(conv);
1811 gc = account->gc; 1811 gc = purple_account_get_connection(account);
1812 1812
1813 model = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkchat->list)); 1813 model = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkchat->list));
1814 1814
1815 gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(gtkchat->list), 1815 gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(gtkchat->list),
1816 event->x, event->y, &path, &column, &x, &y); 1816 event->x, event->y, &path, &column, &x, &y);
2676 int size; 2676 int size;
2677 2677
2678 gtkconv = PIDGIN_CONVERSATION(conv); 2678 gtkconv = PIDGIN_CONVERSATION(conv);
2679 account = purple_conversation_get_account(conv); 2679 account = purple_conversation_get_account(conv);
2680 2680
2681 if (!(account && account->gc)) { 2681 if (!(account && purple_account_get_connection(account))) {
2682 gtkconv->u.im->icon_timer = 0; 2682 gtkconv->u.im->icon_timer = 0;
2683 return FALSE; 2683 return FALSE;
2684 } 2684 }
2685 2685
2686 gdk_pixbuf_animation_iter_advance(gtkconv->u.im->iter, NULL); 2686 gdk_pixbuf_animation_iter_advance(gtkconv->u.im->iter, NULL);
3301 else if (chat) { 3301 else if (chat) {
3302 /* XXX: */ 3302 /* XXX: */
3303 } 3303 }
3304 } else if (node) { 3304 } else if (node) {
3305 if (purple_account_is_connected(account)) 3305 if (purple_account_is_connected(account))
3306 pidgin_append_blist_node_proto_menu(menu, account->gc, node); 3306 pidgin_append_blist_node_proto_menu(menu, purple_account_get_connection(account), node);
3307 pidgin_append_blist_node_extended_menu(menu, node); 3307 pidgin_append_blist_node_extended_menu(menu, node);
3308 } 3308 }
3309 3309
3310 if ((list = gtk_container_get_children(GTK_CONTAINER(menu))) == NULL) { 3310 if ((list = gtk_container_get_children(GTK_CONTAINER(menu))) == NULL) {
3311 ret = FALSE; 3311 ret = FALSE;
4768 PurpleBlistNode *node; 4768 PurpleBlistNode *node;
4769 PurplePluginProtocolInfo *prpl_info; 4769 PurplePluginProtocolInfo *prpl_info;
4770 PurpleAccount *account = purple_conversation_get_account(conv); 4770 PurpleAccount *account = purple_conversation_get_account(conv);
4771 char *who = NULL; 4771 char *who = NULL;
4772 4772
4773 if (account->gc == NULL) 4773 if (purple_account_get_connection(account) == NULL)
4774 return FALSE; 4774 return FALSE;
4775 4775
4776 if (!gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, path)) 4776 if (!gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, path))
4777 return FALSE; 4777 return FALSE;
4778 4778
4779 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, CHAT_USERS_NAME_COLUMN, &who, -1); 4779 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, CHAT_USERS_NAME_COLUMN, &who, -1);
4780 4780
4781 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(account->gc->prpl); 4781 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_account_get_connection(account)->prpl);
4782 node = (PurpleBlistNode*)(purple_find_buddy(purple_conversation_get_account(conv), who)); 4782 node = (PurpleBlistNode*)(purple_find_buddy(purple_conversation_get_account(conv), who));
4783 if (node && prpl_info && (prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) 4783 if (node && prpl_info && (prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME))
4784 pidgin_blist_draw_tooltip(node, gtkconv->infopane); 4784 pidgin_blist_draw_tooltip(node, gtkconv->infopane);
4785 4785
4786 g_free(who); 4786 g_free(who);