pidgin: d09a92cd: More Bonjour struct hiding fixes.

rlaager at pidgin.im rlaager at pidgin.im
Thu Oct 30 18:56:07 EDT 2008


-----------------------------------------------------------------
Revision: d09a92cd7ce9896f92599d245e9964da4ac5b2e1
Ancestor: 2bcc3cbe370d7e6b6c2289752a4cbbab332532e0
Author: rlaager at pidgin.im
Date: 2008-10-30T20:02:30
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/d09a92cd7ce9896f92599d245e9964da4ac5b2e1

Modified files:
        libpurple/protocols/bonjour/buddy.c
        libpurple/protocols/bonjour/jabber.c

ChangeLog: 

More Bonjour struct hiding fixes.

-------------- next part --------------
============================================================
--- libpurple/protocols/bonjour/buddy.c	cb0821f5f2c7b024e39faafa42b29c2dcd144254
+++ libpurple/protocols/bonjour/buddy.c	90aa957aac1ab51f4184dc610cad9605a595d86d
@@ -127,7 +127,7 @@ bonjour_buddy_add_to_purple(BonjourBuddy
 {
 	PurpleGroup *group;
 	PurpleAccount *account = bonjour_buddy->account;
-	const char *status_id, *old_hash, *new_hash;
+	const char *status_id, *old_hash, *new_hash, *name;
 
 	/* Translate between the Bonjour status and the Purple status */
 	if (bonjour_buddy->status != NULL && g_ascii_strcasecmp("dnd", bonjour_buddy->status) == 0)
@@ -158,10 +158,11 @@ bonjour_buddy_add_to_purple(BonjourBuddy
 	}
 
 	buddy->proto_data = bonjour_buddy;
+	name = purple_buddy_get_name(buddy);
 
 	/* Create the alias for the buddy using the first and the last name */
 	if (bonjour_buddy->nick)
-		serv_got_alias(purple_account_get_connection(account), buddy->name, bonjour_buddy->nick);
+		serv_got_alias(purple_account_get_connection(account), name, bonjour_buddy->nick);
 	else {
 		gchar *alias = NULL;
 		const char *first, *last;
@@ -172,18 +173,18 @@ bonjour_buddy_add_to_purple(BonjourBuddy
 						(first && *first ? first : ""),
 						(first && *first && last && *last ? " " : ""),
 						(last && *last ? last : ""));
-		serv_got_alias(purple_account_get_connection(account), buddy->name, alias);
+		serv_got_alias(purple_account_get_connection(account), name, alias);
 		g_free(alias);
 	}
 
 	/* Set the user's status */
 	if (bonjour_buddy->msg != NULL)
-		purple_prpl_got_user_status(account, buddy->name, status_id,
+		purple_prpl_got_user_status(account, name, status_id,
 					    "message", bonjour_buddy->msg, NULL);
 	else
-		purple_prpl_got_user_status(account, buddy->name, status_id, NULL);
+		purple_prpl_got_user_status(account, name, status_id, NULL);
 
-	purple_prpl_got_user_idle(account, buddy->name, FALSE, 0);
+	purple_prpl_got_user_idle(account, name, FALSE, 0);
 
 	/* TODO: Because we don't save Bonjour buddies in blist.xml,
 	 * we will always have to look up the buddy icon at login time.
@@ -198,7 +199,7 @@ bonjour_buddy_add_to_purple(BonjourBuddy
 		 * as what we looked up. */
 		bonjour_dns_sd_retrieve_buddy_icon(bonjour_buddy);
 	} else if (!new_hash)
-		purple_buddy_icons_set_for_user(account, buddy->name, NULL, 0, NULL);
+		purple_buddy_icons_set_for_user(account, name, NULL, 0, NULL);
 }
 
 /**
============================================================
--- libpurple/protocols/bonjour/jabber.c	43e9188ac1443114eac67594c10f2b535099a3a2
+++ libpurple/protocols/bonjour/jabber.c	11233ea49ef6419e39bb1dd414b237b556f52d49
@@ -142,7 +142,7 @@ _jabber_parse_and_write_message_to_ui(xm
 _jabber_parse_and_write_message_to_ui(xmlnode *message_node, PurpleBuddy *pb)
 {
 	xmlnode *body_node, *html_node, *events_node;
-	PurpleConnection *gc = pb->account->gc;
+	PurpleConnection *gc = purple_account_get_connection(purple_buddy_get_account(pb));
 	gchar *body = NULL;
 	gboolean composing_event = FALSE;
 
@@ -225,7 +225,7 @@ _jabber_parse_and_write_message_to_ui(xm
 	}
 
 	/* Send the message to the UI */
-	serv_got_im(gc, pb->name, body, 0, time(NULL));
+	serv_got_im(gc, purple_buddy_get_name(pb), body, 0, time(NULL));
 
 	g_free(body);
 }


More information about the Commits mailing list