changeset 14491:8a1c6ed3dde6

[gaim-migrate @ 17210] SF Patch #1554418 from TiCPU Adds gaim_buddy_get_server_alias(). committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Sat, 09 Sep 2006 21:32:47 +0000
parents f283ebe419e4
children a85299caf0c3
files doc/ChangeLog.API libgaim/blist.c libgaim/blist.h
diffstat 3 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/doc/ChangeLog.API	Sat Sep 09 21:32:30 2006 +0000
+++ b/doc/ChangeLog.API	Sat Sep 09 21:32:47 2006 +0000
@@ -320,6 +320,7 @@
 	* gaim_util_fetch_url_cancel(): Can be used to cancel a pending
 	  call to gaim_util_fetch_url() or gaim_util_fetch_url_request().
 	* GaimGtkWindow: dialogs.search (previously in GaimGtkConversation)
+	* gaim_buddy_get_server_alias()
 
 	Signals - Changed:  (See the Doxygen docs for details on all signals.)
 	* Signal propagation now stops after a handler returns a non-NULL value.
--- a/libgaim/blist.c	Sat Sep 09 21:32:30 2006 +0000
+++ b/libgaim/blist.c	Sat Sep 09 21:32:47 2006 +0000
@@ -2014,6 +2014,16 @@
 	return buddy->name;
 }
 
+const char *gaim_buddy_get_server_alias(GaimBuddy *buddy)
+{
+        g_return_val_if_fail(buddy != NULL, NULL);
+
+	if ((buddy->server_alias) && (*buddy->server_alias))
+	    return buddy->server_alias;
+
+	return NULL;
+}
+
 const char *gaim_buddy_get_local_alias(GaimBuddy *buddy)
 {
 	GaimContact *c;
--- a/libgaim/blist.h	Sat Sep 09 21:32:30 2006 +0000
+++ b/libgaim/blist.h	Sat Sep 09 21:32:47 2006 +0000
@@ -545,6 +545,13 @@
  */
 const char *gaim_buddy_get_alias_only(GaimBuddy *buddy);
 
+/**
+ * Gets the server alias for a buddy.
+ *
+ * @param buddy  The buddy whose name will be returned
+ * @return  The server alias, or NULL if it is not set.
+ */
+const char *gaim_buddy_get_server_alias(GaimBuddy *buddy);
 
 /**
  * Returns the correct name to display for a buddy, taking the contact alias