Mercurial > pidgin
diff libpurple/protocols/jabber/buddy.c @ 25877:1260a3fb60f4
propagate from branch 'im.pidgin.pidgin' (head b8d6086aef6b2e65d86e8ce60220ab7f460d5079)
to branch 'im.pidgin.pidgin.next.minor' (head c165595260a2efa0ca23704ada46a303e0412e19)
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Fri, 12 Dec 2008 20:03:58 +0000 |
parents | aa1fe87558d8 61e0924de04a |
children | 94a6eb10c691 |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/buddy.c Fri Dec 12 17:18:59 2008 +0000 +++ b/libpurple/protocols/jabber/buddy.c Fri Dec 12 20:03:58 2008 +0000 @@ -422,7 +422,7 @@ { PurpleStoredImage *img; JabberIq *iq; - JabberStream *js = gc->proto_data; + JabberStream *js = purple_connection_get_protocol_data(gc); xmlnode *vc_node; const struct tag_attr *tag_attr; @@ -487,7 +487,7 @@ PurplePresence *gpresence; PurpleStatus *status; - if(((JabberStream*)gc->proto_data)->pep) { + if(((JabberStream*)purple_connection_get_protocol_data(gc))->pep) { /* XEP-0084: User Avatars */ if(img) { /* @@ -549,7 +549,7 @@ g_free(base64avatar); /* publish the avatar itself */ - jabber_pep_publish((JabberStream*)gc->proto_data, publish); + jabber_pep_publish((JabberStream*)purple_connection_get_protocol_data(gc), publish); /* next step: publish the metadata */ publish = xmlnode_new("publish"); @@ -575,7 +575,7 @@ g_free(heightstring); /* publish the metadata */ - jabber_pep_publish((JabberStream*)gc->proto_data, publish); + jabber_pep_publish((JabberStream*)purple_connection_get_protocol_data(gc), publish); g_free(hash); } else { /* if(img) */ @@ -592,7 +592,7 @@ xmlnode_new_child(metadata, "stop"); /* publish the metadata */ - jabber_pep_publish((JabberStream*)gc->proto_data, publish); + jabber_pep_publish((JabberStream*)purple_connection_get_protocol_data(gc), publish); } } else { purple_debug(PURPLE_DEBUG_ERROR, "jabber", @@ -1777,7 +1777,7 @@ void jabber_buddy_get_info(PurpleConnection *gc, const char *who) { - JabberStream *js = gc->proto_data; + JabberStream *js = purple_connection_get_protocol_data(gc); JabberID *jid = jabber_id_new(who); if (!jid) @@ -1837,10 +1837,10 @@ g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); buddy = (PurpleBuddy *) node; - gc = purple_account_get_connection(buddy->account); - js = gc->proto_data; + gc = purple_account_get_connection(purple_buddy_get_account(buddy)); + js = purple_connection_get_protocol_data(gc); - jabber_buddy_set_invisibility(js, buddy->name, TRUE); + jabber_buddy_set_invisibility(js, purple_buddy_get_name(buddy), TRUE); } static void jabber_buddy_make_visible(PurpleBlistNode *node, gpointer data) @@ -1852,10 +1852,10 @@ g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); buddy = (PurpleBuddy *) node; - gc = purple_account_get_connection(buddy->account); - js = gc->proto_data; + gc = purple_account_get_connection(purple_buddy_get_account(buddy)); + js = purple_connection_get_protocol_data(gc); - jabber_buddy_set_invisibility(js, buddy->name, FALSE); + jabber_buddy_set_invisibility(js, purple_buddy_get_name(buddy), FALSE); } static void jabber_buddy_cancel_presence_notification(PurpleBlistNode *node, @@ -1868,11 +1868,11 @@ g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); buddy = (PurpleBuddy *) node; - gc = purple_account_get_connection(buddy->account); - js = gc->proto_data; + gc = purple_account_get_connection(purple_buddy_get_account(buddy)); + js = purple_connection_get_protocol_data(gc); /* I wonder if we should prompt the user before doing this */ - jabber_presence_subscription_set(js, buddy->name, "unsubscribed"); + jabber_presence_subscription_set(js, purple_buddy_get_name(buddy), "unsubscribed"); } static void jabber_buddy_rerequest_auth(PurpleBlistNode *node, gpointer data) @@ -1884,10 +1884,10 @@ g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); buddy = (PurpleBuddy *) node; - gc = purple_account_get_connection(buddy->account); - js = gc->proto_data; + gc = purple_account_get_connection(purple_buddy_get_account(buddy)); + js = purple_connection_get_protocol_data(gc); - jabber_presence_subscription_set(js, buddy->name, "subscribe"); + jabber_presence_subscription_set(js, purple_buddy_get_name(buddy), "subscribe"); } @@ -1900,18 +1900,18 @@ g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); buddy = (PurpleBuddy *) node; - gc = purple_account_get_connection(buddy->account); - js = gc->proto_data; + gc = purple_account_get_connection(purple_buddy_get_account(buddy)); + js = purple_connection_get_protocol_data(gc); - jabber_presence_subscription_set(js, buddy->name, "unsubscribe"); + jabber_presence_subscription_set(js, purple_buddy_get_name(buddy), "unsubscribe"); } static void jabber_buddy_login(PurpleBlistNode *node, gpointer data) { if(PURPLE_BLIST_NODE_IS_BUDDY(node)) { /* simply create a directed presence of the current status */ PurpleBuddy *buddy = (PurpleBuddy *) node; - PurpleConnection *gc = purple_account_get_connection(buddy->account); - JabberStream *js = gc->proto_data; + PurpleConnection *gc = purple_account_get_connection(purple_buddy_get_account(buddy)); + JabberStream *js = purple_connection_get_protocol_data(gc); PurpleAccount *account = purple_connection_get_account(gc); PurplePresence *gpresence = purple_account_get_presence(account); PurpleStatus *status = purple_presence_get_active_status(gpresence); @@ -1925,7 +1925,7 @@ g_free(msg); - xmlnode_set_attrib(presence, "to", buddy->name); + xmlnode_set_attrib(presence, "to", purple_buddy_get_name(buddy)); jabber_send(js, presence); xmlnode_free(presence); @@ -1936,12 +1936,13 @@ if(PURPLE_BLIST_NODE_IS_BUDDY(node)) { /* simply create a directed unavailable presence */ PurpleBuddy *buddy = (PurpleBuddy *) node; - JabberStream *js = purple_account_get_connection(buddy->account)->proto_data; + PurpleConnection *gc = purple_account_get_connection(purple_buddy_get_account(buddy)); + JabberStream *js = purple_connection_get_protocol_data(gc); xmlnode *presence; presence = jabber_presence_create_js(js, JABBER_BUDDY_STATE_UNAVAILABLE, NULL, 0); - xmlnode_set_attrib(presence, "to", buddy->name); + xmlnode_set_attrib(presence, "to", purple_buddy_get_name(buddy)); jabber_send(js, presence); xmlnode_free(presence); @@ -1950,9 +1951,10 @@ static GList *jabber_buddy_menu(PurpleBuddy *buddy) { - PurpleConnection *gc = purple_account_get_connection(buddy->account); - JabberStream *js = gc->proto_data; - JabberBuddy *jb = jabber_buddy_find(js, buddy->name, TRUE); + PurpleConnection *gc = purple_account_get_connection(purple_buddy_get_account(buddy)); + JabberStream *js = purple_connection_get_protocol_data(gc); + const char *name = purple_buddy_get_name(buddy); + JabberBuddy *jb = jabber_buddy_find(js, name, TRUE); GList *jbrs; GList *m = NULL; @@ -2007,7 +2009,7 @@ * that gateways on the roster can be identified by having no '@' in their jid. This is a faily safe assumption, since * people don't tend to have a server or other service there. */ - if (g_utf8_strchr(buddy->name, -1, '@') == NULL) { + if (g_utf8_strchr(name, -1, '@') == NULL) { act = purple_menu_action_new(_("Log In"), PURPLE_CALLBACK(jabber_buddy_login), NULL, NULL); @@ -2475,7 +2477,7 @@ void jabber_user_search_begin(PurplePluginAction *action) { PurpleConnection *gc = (PurpleConnection *) action->context; - JabberStream *js = gc->proto_data; + JabberStream *js = purple_connection_get_protocol_data(gc); purple_request_input(gc, _("Enter a User Directory"), _("Enter a User Directory"), _("Select a user directory to search"),