From df5967079cb25c6b519b55ae4c34dfafd5a55f65 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Mon, 8 May 2017 14:14:31 +0400 Subject: [PATCH] Display users correctly in longtweets. Fixes #135 --- doc/changelog.md | 1 + src/sessionmanager/session.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/changelog.md b/doc/changelog.md index 962c6326..5cd36f0e 100644 --- a/doc/changelog.md +++ b/doc/changelog.md @@ -8,6 +8,7 @@ * Now TWBlue will use Yandex's translation services instead microsoft translator. ([#132](https://github.com/manuelcortez/TWBlue/issues/132)) * SndUp users will be able to upload audio in their account by using their API Key again. ([#134](https://github.com/manuelcortez/TWBlue/issues/134)) * old tweets shouldn't be added as new items in buffers. ([#116,](https://github.com/manuelcortez/TWBlue/issues/116)) ([#133](https://github.com/manuelcortez/TWBlue/issues/133)) +* All mentionned users should be displayed correctly in Twishort's long tweets. ([#116,](https://github.com/manuelcortez/TWBlue/issues/116)) ([#135](https://github.com/manuelcortez/TWBlue/issues/135)) ## Changes in version 0.90 diff --git a/src/sessionmanager/session.py b/src/sessionmanager/session.py index bba6ac72..28c1cee0 100644 --- a/src/sessionmanager/session.py +++ b/src/sessionmanager/session.py @@ -472,8 +472,8 @@ class Session(object): if tweet["message"] == False: return False tweet["twishort"] = True for i in tweet["entities"]["user_mentions"]: - if "@%s" % (i["screen_name"] not in tweet["message"]) and i["screen_name"] != tweet["user"]["screen_name"]: + if "@%s" % (i["screen_name"]) not in tweet["message"] and i["screen_name"] != tweet["user"]["screen_name"]: if tweet.has_key("retweeted_status") and tweet["retweeted_status"]["user"]["screen_name"] == i["screen_name"]: continue - tweet["message"] = u"@%s %s" % (i["screen_name"], tweet["message"]) + tweet["message"] = u"@%s %s" % (i["screen_name"], tweet["message"]) return tweet \ No newline at end of file