Mercurial > pidgin.yaz
changeset 32341:1346f7f65588
If a contact did not have a status-message or mood set, the "status_text" callback would return an empty ("") string.
This causes the buddy list (with buddy details enabled) to display the contact's alias not in line with the status icon - which looked odd.
Now we return NULL if there is no status-message or mood set.
author | andrew.victor@mxit.com |
---|---|
date | Sat, 13 Aug 2011 15:08:30 +0000 |
parents | 94b71f521edb |
children | 9ad5fcde4af4 |
files | libpurple/protocols/mxit/mxit.c |
diffstat | 1 files changed, 7 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/mxit/mxit.c Sat Aug 13 13:13:19 2011 +0000 +++ b/libpurple/protocols/mxit/mxit.c Sat Aug 13 15:08:30 2011 +0000 @@ -309,19 +309,18 @@ */ char* mxit_status_text( PurpleBuddy* buddy ) { + char* text = NULL; struct contact* contact = purple_buddy_get_protocol_data(buddy); if ( !contact ) return NULL; - if ( contact->statusMsg ) { - /* status message */ - return g_strdup( contact-> statusMsg ); - } - else { - /* mood */ - return g_strdup( mxit_convert_mood_to_name( contact->mood ) ); - } + if ( contact->statusMsg ) /* status message */ + text = g_strdup( contact-> statusMsg ); + else if ( contact->mood != MXIT_MOOD_NONE ) /* mood */ + text = g_strdup( mxit_convert_mood_to_name( contact->mood ) ); + + return text; }