comparison libpurple/protocols/msn/msn.c @ 20502:b5a2938b4549

Fixes #2502, now we show the status name in the tooltip instead of "Status" if the buddy is not available
author Ka-Hing Cheung <khc@hxbc.us>
date Wed, 12 Sep 2007 02:40:56 +0000
parents 64c322c3b1b0
children 723b5a2f91ce
comparison
equal deleted inserted replaced
20501:f6dff814d95f 20502:b5a2938b4549
580 user = buddy->proto_data; 580 user = buddy->proto_data;
581 581
582 582
583 if (purple_presence_is_online(presence)) 583 if (purple_presence_is_online(presence))
584 { 584 {
585 const char *psm, *currentmedia; 585 const char *psm, *currentmedia, *name;
586 char *tmp; 586 char *tmp;
587 587
588 psm = purple_status_get_attr_string(status, "message"); 588 psm = purple_status_get_attr_string(status, "message");
589 currentmedia = purple_status_get_attr_string(status, "currentmedia"); 589 currentmedia = purple_status_get_attr_string(status, "currentmedia");
590 590
591 if (psm && *psm) { 591 if (!purple_presence_is_available(presence)) {
592 name = purple_status_get_name(status);
593 } else {
594 name = NULL;
595 }
596
597 if (name != NULL && *name) {
598 char *tmp2 = g_markup_escape_text(name, -1);
599
600 if (psm != NULL && *psm) {
601 tmp = g_markup_escape_text(psm, -1);
602 purple_notify_user_info_add_pair(user_info, tmp2, tmp);
603 g_free(tmp);
604 } else {
605 purple_notify_user_info_add_pair(user_info, _("Status"), tmp2);
606 }
607
608 g_free(tmp2);
609 } else {
592 tmp = g_markup_escape_text(psm, -1); 610 tmp = g_markup_escape_text(psm, -1);
593 purple_notify_user_info_add_pair(user_info, _("Status"), tmp); 611 purple_notify_user_info_add_pair(user_info, _("Status"), tmp);
594 g_free(tmp); 612 g_free(tmp);
595 } 613 }
596 614