comparison libpurple/protocols/yahoo/yahoo_profile.c @ 31810:0123c69ec0e5

Add a purple_notify_user_info_add_pair_plaintext function that accepts a plaintext value and escapes it. This is a convenience function. Previously callers would have to escape the value themselves. The motivation for this is that a lot of callers didn't escape the value when they should have. See these screenshots for an example of the problem this causes: Here's what I set my jabber info to: http://img29.imageshack.us/i/screenshotafter.png/ Here's what the old code displayed when I viewed info for myself (incorrect): http://img691.imageshack.us/i/screenshotbeforev.png/ Here's what the new code displays (correct): http://img192.imageshack.us/i/screenshotafter.png/
author Mark Doliner <mark@kingant.net>
date Thu, 08 Jul 2010 22:38:33 +0000
parents 908be3822215
children 7281d151e492 dc3ea8f6381a
comparison
equal deleted inserted replaced
31809:dffc3c494168 31810:0123c69ec0e5
699 info_data->name); 699 info_data->name);
700 700
701 if (b) { 701 if (b) {
702 const char *balias = purple_buddy_get_local_buddy_alias(b); 702 const char *balias = purple_buddy_get_local_buddy_alias(b);
703 if(balias && balias[0]) { 703 if(balias && balias[0]) {
704 char *aliastext = g_markup_escape_text(balias, -1); 704 purple_notify_user_info_add_pair_plaintext(user_info, _("Alias"), balias);
705 purple_notify_user_info_add_pair(user_info, _("Alias"), aliastext);
706 g_free(aliastext);
707 } 705 }
708 #if 0 706 #if 0
709 if (b->idle > 0) { 707 if (b->idle > 0) {
710 char *idletime = purple_str_seconds_to_string(time(NULL) - b->idle); 708 char *idletime = purple_str_seconds_to_string(time(NULL) - b->idle);
711 purple_notify_user_info_add_pair(user_info, _("Idle"), idletime); 709 purple_notify_user_info_add_pair_plaintext(user_info, _("Idle"), idletime);
712 g_free(idletime); 710 g_free(idletime);
713 } 711 }
714 #endif 712 #endif
715 713
716 /* Add the normal tooltip pairs */ 714 /* Add the normal tooltip pairs */
717 yahoo_tooltip_text(b, user_info, TRUE); 715 yahoo_tooltip_text(b, user_info, TRUE);
718 716
719 if ((f = yahoo_friend_find(info_data->gc, purple_buddy_get_name(b)))) { 717 if ((f = yahoo_friend_find(info_data->gc, purple_buddy_get_name(b)))) {
720 const char *ip; 718 const char *ip;
721 if ((ip = yahoo_friend_get_ip(f))) 719 if ((ip = yahoo_friend_get_ip(f)))
722 purple_notify_user_info_add_pair(user_info, _("IP Address"), ip); 720 purple_notify_user_info_add_pair_plaintext(user_info, _("IP Address"), ip);
723 } 721 }
724 } 722 }
725 } 723 }
726 724
727 #if PHOTO_SUPPORT 725 #if PHOTO_SUPPORT