diff src/protocols/yahoo/yahoo.c @ 11920:52f27ffe68a5

[gaim-migrate @ 14211] sf patch #1339035, from Sadrul Habib Chowdhury "Remove the \n in Yahoo! status messages when showing them in the buddy list inline." Also some changes from me. I changed gaim_str_strip_cr(char *text) to gaim_str_strip_char(char *text, char thechar). I don't know why, really, but it seems like it could be more useful this way. Eh committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 31 Oct 2005 04:27:06 +0000
parents 2219f4bf4a57
children 498a1b29fb11
line wrap: on
line diff
--- a/src/protocols/yahoo/yahoo.c	Mon Oct 31 03:55:56 2005 +0000
+++ b/src/protocols/yahoo/yahoo.c	Mon Oct 31 04:27:06 2005 +0000
@@ -744,7 +744,7 @@
 		}
 
 		m = yahoo_string_decode(gc, im->msg, im->utf8);
-		gaim_str_strip_cr(m);
+		gaim_str_strip_char(m, '\r');
 
 		if (!strcmp(m, "<ding>")) {
 			GaimConversation *c = gaim_conversation_new(GAIM_CONV_TYPE_IM,
@@ -2717,6 +2717,7 @@
 {
 	YahooFriend *f = NULL;
 	const char *msg;
+	char *msg2;
 
 	f = yahoo_friend_find(b->account->gc, b->name);
 	if (!f)
@@ -2732,7 +2733,9 @@
 	case YAHOO_STATUS_CUSTOM:
 		if (!(msg = yahoo_friend_get_status_message(f)))
 			return NULL;
-		return g_markup_escape_text(msg, strlen(msg));
+		msg2 = g_markup_escape_text(msg, strlen(msg));
+		gaim_util_chrreplace(msg2, '\n', ' ');
+		return msg2;
 
 	default:
 		return g_strdup(yahoo_get_status_string(f->status));