pidgin.next.minor: cee90a38: Alias foo. I think blist.h structs are n...

sadrul at pidgin.im sadrul at pidgin.im
Fri Oct 31 17:05:37 EDT 2008


-----------------------------------------------------------------
Revision: cee90a384bbe720ad5a9b7a04677c31554ae7192
Ancestor: 3d03f05ca767de265f0ed0be9deb70c159b347c5
Author: sadrul at pidgin.im
Date: 2008-10-31T21:06:26
Branch: im.pidgin.pidgin.next.minor
URL: http://d.pidgin.im/viewmtn/revision/info/cee90a384bbe720ad5a9b7a04677c31554ae7192

Modified files:
        ChangeLog.API libpurple/blist.c libpurple/blist.h
        libpurple/protocols/jabber/google.c
        libpurple/protocols/jabber/roster.c
        libpurple/protocols/msn/msn.c
        libpurple/protocols/novell/novell.c
        libpurple/protocols/oscar/oscar.c
        libpurple/protocols/sametime/sametime.c
        libpurple/protocols/yahoo/yahoo_profile.c
        libpurple/protocols/zephyr/zephyr.c

ChangeLog: 

Alias foo. I think blist.h structs are now completely hidden.

-------------- next part --------------
============================================================
--- ChangeLog.API	4b923886c8ebf9047dab1f6b466fbc87666d98a5
+++ ChangeLog.API	dc2cc5a7238b65cdabccb4c7f82c96efee4ae950
@@ -7,6 +7,7 @@ version 2.6.0 (??/??/????):
 		* purple_buddy_set_protocol_data
 		* purple_connection_get_protocol_data
 		* purple_connection_set_protocol_data
+		* purple_buddy_get_local_buddy_alias
 
 		Deprecated:
 		* purple_buddy_get_local_alias
============================================================
--- libpurple/blist.c	6370e2da92d06b77c9f750a3504fb2aaa9912ab6
+++ libpurple/blist.c	0065037a32b6948a319767f7c648f9ec2e33ae68
@@ -2061,6 +2061,12 @@ const char *purple_buddy_get_alias(Purpl
 	return buddy->name;
 }
 
+const char *purple_buddy_get_local_buddy_alias(PurpleBuddy *buddy)
+{
+	g_return_val_if_fail(buddy, NULL);
+	return buddy->alias;
+}
+
 const char *purple_buddy_get_server_alias(PurpleBuddy *buddy)
 {
         g_return_val_if_fail(buddy != NULL, NULL);
============================================================
--- libpurple/blist.h	5b103289c679c53d40ac6707976a68330b68dbd9
+++ libpurple/blist.h	3ebe49fb0d6b9ea11034963b473f24aaf88e3070
@@ -709,6 +709,14 @@ const char *purple_buddy_get_alias(Purpl
 const char *purple_buddy_get_alias(PurpleBuddy *buddy);
 
 /**
+ * Returns the local alias for the buddy, or @c NULL if none exists.
+ *
+ * @param buddy  The buddy
+ * @return       The local alias for the buddy
+ */
+const char *purple_buddy_get_local_buddy_alias(PurpleBuddy *buddy);
+
+/**
  * Returns the correct name to display for a blist chat.
  *
  * @param chat   The chat whose name will be returned.
============================================================
--- libpurple/protocols/jabber/google.c	6dcfe763023f25206f523572bfa884a0c5fa20fb
+++ libpurple/protocols/jabber/google.c	01f74e1c5f5194657f1c7dab0d9702e2ff58a28e
@@ -283,6 +283,7 @@ void jabber_google_roster_add_deny(Purpl
 	xmlnode *group;
 	PurpleBuddy *b;
 	JabberBuddy *jb;
+	const char *balias;
 
 	js = (JabberStream*)(gc->proto_data);
 
@@ -314,8 +315,9 @@ void jabber_google_roster_add_deny(Purpl
 		buddies = buddies->next;
 	}
 
+	balias = purple_buddy_get_local_buddy_alias(b);
 	xmlnode_set_attrib(item, "jid", who);
-	xmlnode_set_attrib(item, "name", b->alias ? b->alias : "");
+	xmlnode_set_attrib(item, "name", balias ? balias : "");
 	xmlnode_set_attrib(item, "gr:t", "B");
 	xmlnode_set_attrib(query, "xmlns:gr", "google:roster");
 	xmlnode_set_attrib(query, "gr:ext", "2");
@@ -348,6 +350,7 @@ void jabber_google_roster_rem_deny(Purpl
 	xmlnode *item;
 	xmlnode *group;
 	PurpleBuddy *b;
+	const char *balias;
 
 	g_return_if_fail(gc != NULL);
 	g_return_if_fail(who != NULL);
@@ -380,8 +383,9 @@ void jabber_google_roster_rem_deny(Purpl
 		buddies = buddies->next;
 	}
 
+	balias = purple_buddy_get_local_buddy_alias(b);
 	xmlnode_set_attrib(item, "jid", who);
-	xmlnode_set_attrib(item, "name", b->alias ? b->alias : "");
+	xmlnode_set_attrib(item, "name", balias ? balias : "");
 	xmlnode_set_attrib(query, "xmlns:gr", "google:roster");
 	xmlnode_set_attrib(query, "gr:ext", "2");
 
============================================================
--- libpurple/protocols/jabber/roster.c	735181ee13268d07c550edb05a3aa9a6058d21bb
+++ libpurple/protocols/jabber/roster.c	4991823f23b5b22824a3cb8bbd4345d8e59e9ea2
@@ -81,14 +81,15 @@ static void add_purple_buddies_to_groups
 		buddies = g_slist_remove(buddies, b);
 
 		if((l = g_slist_find_custom(g2, purple_group_get_name(g), (GCompareFunc)strcmp))) {
-			const char *servernick;
+			const char *servernick, *balias;
 
 			/* Previously stored serverside / buddy-supplied alias */
 			if((servernick = purple_blist_node_get_string((PurpleBlistNode*)b, "servernick")))
 				serv_got_alias(js->gc, jid, servernick);
 
 			/* Alias from our roster retrieval */
-			if(alias && (!b->alias || strcmp(b->alias, alias)))
+			balias = purple_buddy_get_local_buddy_alias(b);
+			if(alias && (!balias || strcmp(balias, alias)))
 				purple_serv_got_private_alias(js->gc, jid, alias);
 			g_free(l->data);
 			g2 = g_slist_delete_link(g2, l);
@@ -275,6 +276,7 @@ static void jabber_roster_update(JabberS
 	GSList *groups = NULL, *l;
 	JabberIq *iq;
 	xmlnode *query, *item, *group;
+	const char *balias;
 
 	if (js->currently_parsing_roster_push)
 		return;
@@ -303,7 +305,8 @@ static void jabber_roster_update(JabberS
 
 	xmlnode_set_attrib(item, "jid", name);
 
-	xmlnode_set_attrib(item, "name", b->alias ? b->alias : "");
+	balias = purple_buddy_get_local_buddy_alias(b);
+	xmlnode_set_attrib(item, "name", balias ? balias : "");
 
 	for(l = groups; l; l = l->next) {
 		group = xmlnode_new_child(item, "group");
============================================================
--- libpurple/protocols/msn/msn.c	cf2b2f8326eaa44e81e6edd36abefd9df6127625
+++ libpurple/protocols/msn/msn.c	fd104c3b46480470be9be1a3dad918d88f9ed6a1
@@ -1817,9 +1817,10 @@ msn_tooltip_extract_info_text(PurpleNoti
 		char *tmp;
 		const char *alias;
 
-		if (b->alias && b->alias[0])
+		alias = purple_buddy_get_local_buddy_alias(b);
+		if (alias && alias[0])
 		{
-			char *aliastext = g_markup_escape_text(b->alias, -1);
+			char *aliastext = g_markup_escape_text(alias, -1);
 			purple_notify_user_info_add_pair(user_info, _("Alias"), aliastext);
 			g_free(aliastext);
 		}
============================================================
--- libpurple/protocols/novell/novell.c	09c924f4edebb8e0e82ec9879c1cd832ef00ce36
+++ libpurple/protocols/novell/novell.c	54b1950abdd454a918fc1d4e2eae329594f98aa3
@@ -2687,9 +2687,11 @@ novell_alias_buddy(PurpleConnection * gc
 				}
 
 				if (group) {
+					const char *balias;
 					buddy = purple_find_buddy_in_group(user->client_data,
 													 name, group);
-					if (buddy && strcmp(buddy->alias, alias))
+					balias = buddy ? purple_buddy_get_local_buddy_alias(buddy) : NULL;
+					if (balias && strcmp(balias, alias))
 						purple_blist_alias_buddy(buddy, alias);
 				}
 
============================================================
--- libpurple/protocols/oscar/oscar.c	b07c8f334e0b3f7f8ebd258ecac3e2a6383b8ed6
+++ libpurple/protocols/oscar/oscar.c	5cf2b2a83bd8d46a143d9f8d78e9e8e334206c98
@@ -5049,13 +5049,15 @@ static int purple_ssi_parselist(OscarDat
 								/* If the buddy is an ICQ user then load his nickname */
 								const char *servernick = purple_blist_node_get_string((PurpleBlistNode*)b, "servernick");
 								char *alias;
+								const char *balias;
 								if (servernick)
 									serv_got_alias(gc, bname, servernick);
 
 								/* Store local alias on server */
 								alias = aim_ssi_getalias(od->ssi.local, gname, bname);
-								if (!alias && b->alias && strlen(b->alias))
-									aim_ssi_aliasbuddy(od, gname, bname, b->alias);
+								balias = purple_buddy_get_local_buddy_alias(b);
+								if (!alias && balias && *balias)
+									aim_ssi_aliasbuddy(od, gname, bname, balias);
 								g_free(alias);
 							} else {
 								purple_debug_info("oscar",
============================================================
--- libpurple/protocols/sametime/sametime.c	fe4e3730754ddd5f602097720da6cc86ad973c7c
+++ libpurple/protocols/sametime/sametime.c	af2036c86a0e3bdd4d9b980c62245191fc760094
@@ -732,7 +732,7 @@ static void blist_export(PurpleConnectio
 
 	  stu = mwSametimeUser_new(stg, utype, &idb);
 	  mwSametimeUser_setShortName(stu, purple_buddy_get_server_alias(bdy));
-	  mwSametimeUser_setAlias(stu, bdy->alias);
+	  mwSametimeUser_setAlias(stu, purple_buddy_get_local_buddy_alias(bdy));
 	}
       }
     }
============================================================
--- libpurple/protocols/yahoo/yahoo_profile.c	38456958cc93c616e704c21f677a034d747ee004
+++ libpurple/protocols/yahoo/yahoo_profile.c	2c69c4133d66f04fe8ae96d6b6645e97d7563e92
@@ -699,8 +699,9 @@ static void yahoo_extract_user_info_text
 			info_data->name);
 
 	if (b) {
-		if(b->alias && b->alias[0]) {
-			char *aliastext = g_markup_escape_text(b->alias, -1);
+		const char *balias = purple_buddy_get_local_buddy_alias(b);
+		if(balias && balias[0]) {
+			char *aliastext = g_markup_escape_text(balias, -1);
 			purple_notify_user_info_add_pair(user_info, _("Alias"), aliastext); 
 			g_free(aliastext);
 		}
============================================================
--- libpurple/protocols/zephyr/zephyr.c	8ad7edcc44e4311cd97bd430bd1ed6343d2a7faa
+++ libpurple/protocols/zephyr/zephyr.c	e9e75838c85edf2ca04e3db9b2e77c4b9b3e45a4
@@ -789,10 +789,12 @@ static void handle_message(PurpleConnect
 				int one = 1;
 				PurpleNotifyUserInfo *user_info = purple_notify_user_info_new();
 				char *tmp;
+				const char *balias;
 
 				purple_notify_user_info_add_pair(user_info, _("User"), (b ? bname : user));
-				if (b && b->alias)
-					purple_notify_user_info_add_pair(user_info, _("Alias"), b->alias);
+				balias = purple_buddy_get_local_buddy_alias(b);
+				if (b && balias)
+					purple_notify_user_info_add_pair(user_info, _("Alias"), balias);
 
 				if (!nlocs) {
 					purple_notify_user_info_add_pair(user_info, NULL, _("Hidden or not logged-in"));
@@ -1170,12 +1172,14 @@ static gint check_notify_tzc(gpointer da
 				if ((b && pending_zloc(zephyr,bname)) || pending_zloc(zephyr,user) || pending_zloc(zephyr,local_zephyr_normalize(zephyr,user))){
 					PurpleNotifyUserInfo *user_info = purple_notify_user_info_new();
 					char *tmp;
+					const char *balias;
 
 					purple_notify_user_info_add_pair(user_info, _("User"), (b ? bname : user));
 
-					if (b && b->alias)
-						purple_notify_user_info_add_pair(user_info, _("Alias"), b->alias);
-											
+					balias = b ? purple_buddy_get_local_buddy_alias(b) : NULL;
+					if (balias)
+						purple_notify_user_info_add_pair(user_info, _("Alias"), balias);
+
 					if (!nlocs) {
 						purple_notify_user_info_add_pair(user_info, NULL, _("Hidden or not logged-in"));
 					} else {


More information about the Commits mailing list