comparison libpurple/protocols/mxit/mxit.c @ 31883: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 66fa012633e9
children 9ad5fcde4af4
comparison
equal deleted inserted replaced
31882:94b71f521edb 31883:1346f7f65588
307 * @param buddy The buddy. 307 * @param buddy The buddy.
308 * @return The status text 308 * @return The status text
309 */ 309 */
310 char* mxit_status_text( PurpleBuddy* buddy ) 310 char* mxit_status_text( PurpleBuddy* buddy )
311 { 311 {
312 char* text = NULL;
312 struct contact* contact = purple_buddy_get_protocol_data(buddy); 313 struct contact* contact = purple_buddy_get_protocol_data(buddy);
313 314
314 if ( !contact ) 315 if ( !contact )
315 return NULL; 316 return NULL;
316 317
317 if ( contact->statusMsg ) { 318 if ( contact->statusMsg ) /* status message */
318 /* status message */ 319 text = g_strdup( contact-> statusMsg );
319 return g_strdup( contact-> statusMsg ); 320 else if ( contact->mood != MXIT_MOOD_NONE ) /* mood */
320 } 321 text = g_strdup( mxit_convert_mood_to_name( contact->mood ) );
321 else { 322
322 /* mood */ 323 return text;
323 return g_strdup( mxit_convert_mood_to_name( contact->mood ) );
324 }
325 } 324 }
326 325
327 326
328 /*------------------------------------------------------------------------ 327 /*------------------------------------------------------------------------
329 * Return UI tooltip information for a buddy when hovering in buddy list. 328 * Return UI tooltip information for a buddy when hovering in buddy list.