From 8b77c1ba74a24af5ec831385fc876807aed509c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Mon, 27 Jul 2015 09:05:52 +0000 Subject: Twitter: Replace few more html entities with text representation git-svn-id: http://svn.miranda-ng.org/main/trunk@14734 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Twitter/src/twitter.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'protocols/Twitter/src/twitter.cpp') diff --git a/protocols/Twitter/src/twitter.cpp b/protocols/Twitter/src/twitter.cpp index 64eca48940..aa94f34dbb 100644 --- a/protocols/Twitter/src/twitter.cpp +++ b/protocols/Twitter/src/twitter.cpp @@ -240,19 +240,17 @@ std::vector twitter::get_statuses(int count, twitter_id id) std::string retweeteesName = pUser2["screen_name"].as_string(); // the user that is being retweeted std::string retweetText = pRetweet["text"].as_string(); // their tweet in all it's untruncated glory - // fix "&" in the tweets :( - for (size_t pos = 0; (pos = retweetText.find("&", pos)) != std::string::npos; pos++) - retweetText.replace(pos, 5, "&"); + // fix html entities in the text + htmlEntitiesDecode(retweetText); u.status.text = "RT @" + retweeteesName + " " + retweetText; // mash it together in some format people will understand } else { - // if it's not truncated, then the twitter API returns the native RT correctly anyway, + // if it's not truncated, then the twitter API returns the native RT correctly anyway, std::string rawText = one["text"].as_string(); - // ok here i'm trying some way to fix all the "&" things that are showing up - // i dunno why it's happening, so i'll just find and replace each occurance :/ - for (size_t pos = 0; (pos = rawText.find("&", pos)) != std::string::npos; pos++) - rawText.replace(pos, 5, "&"); + + // fix html entities in the text + htmlEntitiesDecode(rawText); u.status.text = rawText; } -- cgit v1.2.3