Mercurial > pidgin.yaz
diff libpurple/protocols/sametime/sametime.c @ 18599:4efd240ffaa0
merge of '21c2a204378d0369b8d2b6d7b32b6da45cb1ddb2'
and 'a55d49d8370e0e949cd461b528bc84ac435e93e9'
author | Ka-Hing Cheung <khc@hxbc.us> |
---|---|
date | Sun, 22 Jul 2007 00:59:51 +0000 |
parents | 8261beed9653 |
children | b8cbc7659a5a 5734f1c98a37 |
line wrap: on
line diff
--- a/libpurple/protocols/sametime/sametime.c Sun Jul 22 00:58:25 2007 +0000 +++ b/libpurple/protocols/sametime/sametime.c Sun Jul 22 00:59:51 2007 +0000 @@ -3189,7 +3189,8 @@ pd = gc->proto_data; ret = mwServiceAware_getText(pd->srvc_aware, &t); - return ret? g_markup_escape_text(ret, -1): NULL; + + return (ret && g_utf8_validate(ret, -1, NULL)) ? g_markup_escape_text(ret, -1): NULL; } @@ -3254,7 +3255,7 @@ message = mwServiceAware_getText(pd->srvc_aware, &idb); status = status_text(b); - if(message != NULL && purple_utf8_strcasecmp(status, message)) { + if(message != NULL && g_utf8_validate(message, -1, NULL) && purple_utf8_strcasecmp(status, message)) { tmp = g_markup_escape_text(message, -1); purple_notify_user_info_add_pair(user_info, status, tmp); g_free(tmp); @@ -4151,7 +4152,7 @@ /* XXX Is this adding a status message in its own section rather than with the "Status" label? */ tmp2 = mwServiceAware_getText(pd->srvc_aware, &idb); - if(tmp2) { + if(tmp2 && g_utf8_validate(tmp2, -1, NULL)) { tmp = g_markup_escape_text(tmp2, -1); purple_notify_user_info_add_section_break(user_info); purple_notify_user_info_add_pair(user_info, NULL, tmp);