# HG changeset patch # User Richard Laager # Date 1157837567 0 # Node ID 8a1c6ed3dde6300dfa8ebcaab600ff8206239f3d # Parent f283ebe419e4ee651b3d520c234d5d0618bf4244 [gaim-migrate @ 17210] SF Patch #1554418 from TiCPU Adds gaim_buddy_get_server_alias(). committer: Tailor Script diff -r f283ebe419e4 -r 8a1c6ed3dde6 doc/ChangeLog.API --- 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. diff -r f283ebe419e4 -r 8a1c6ed3dde6 libgaim/blist.c --- 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; diff -r f283ebe419e4 -r 8a1c6ed3dde6 libgaim/blist.h --- 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