Display users correctly in longtweets. Fixes #135

This commit is contained in:
Manuel Cortez 2017-05-08 14:14:31 +04:00
parent 0a3219d12a
commit df5967079c
2 changed files with 3 additions and 2 deletions

View File

@ -8,6 +8,7 @@
* Now TWBlue will use Yandex's translation services instead microsoft translator. ([#132](https://github.com/manuelcortez/TWBlue/issues/132)) * 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)) * 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)) * 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 ## Changes in version 0.90

View File

@ -472,7 +472,7 @@ class Session(object):
if tweet["message"] == False: return False if tweet["message"] == False: return False
tweet["twishort"] = True tweet["twishort"] = True
for i in tweet["entities"]["user_mentions"]: 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"]: if tweet.has_key("retweeted_status") and tweet["retweeted_status"]["user"]["screen_name"] == i["screen_name"]:
continue continue
tweet["message"] = u"@%s %s" % (i["screen_name"], tweet["message"]) tweet["message"] = u"@%s %s" % (i["screen_name"], tweet["message"])