diff libpurple/blist.c @ 20550:28493a27849b

Looking at purple_contact_set_alias and purple_blist_alias_contact functions in blist.c, the only difference I see is that the latter function notifies any existing conversation with the contact so that it can update its title, while the former doesn't. I can't think of a reason why they should behave differently, or why we should have both of them. I was going to deprecate purple_blist_alias_contact in favour of purple_contact_set_alias, but seeing we do purple_blist_alias_ for buddy and chats, I am deprecating purple_contact_set_alias instead. OK?
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 19 Sep 2007 10:01:45 +0000
parents ec75e26e72b3
children 4c910fcb5b0a
line wrap: on
line diff
--- a/libpurple/blist.c	Wed Sep 19 09:52:54 2007 +0000
+++ b/libpurple/blist.c	Wed Sep 19 10:01:45 2007 +0000
@@ -1442,29 +1442,7 @@
 
 void purple_contact_set_alias(PurpleContact *contact, const char *alias)
 {
-	PurpleBlistUiOps *ops = purple_blist_get_ui_ops();
-	char *old_alias;
-
-	g_return_if_fail(contact != NULL);
-
-	if (!purple_strings_are_different(contact->alias, alias))
-		return;
-
-	old_alias = contact->alias;
-
-	if ((alias != NULL) && (*alias != '\0'))
-		contact->alias = g_strdup(alias);
-	else
-		contact->alias = NULL;
-
-	purple_blist_schedule_save();
-
-	if (ops && ops->update)
-		ops->update(purplebuddylist, (PurpleBlistNode*)contact);
-
-	purple_signal_emit(purple_blist_get_handle(), "blist-node-aliased",
-					 contact, old_alias);
-	g_free(old_alias);
+	purple_blist_alias_contact(contact,alias);
 }
 
 const char *purple_contact_get_alias(PurpleContact* contact)