Links in quoted tweets should be opened properly. Fixes #167 and #184

This commit is contained in:
Manuel Cortez 2017-11-15 09:50:59 -06:00
parent 6a3b498d52
commit 8928a64a12
2 changed files with 5 additions and 0 deletions

View File

@ -31,4 +31,8 @@ def clear_url(tweet):
urls = utils.find_urls_in_text(tweet[value])
try: tweet["message"] = tweet["message"].replace(urls[-1], "")
except IndexError: pass
try:
tweet["entities"]["urls"].remove(tweet["entities"]["urls"][-1])
except ValueError:
pass
return tweet

View File

@ -123,6 +123,7 @@ def compose_quoted_tweet(quoted_tweet, original_tweet, show_screen_names=False):
original_text = StripChars(original_tweet["text"])
quoted_tweet["message"] = _(u"{0}. Quoted tweet from @{1}: {2}").format( quoted_tweet[value], original_user, original_text)
quoted_tweet = tweets.clear_url(quoted_tweet)
quoted_tweet["entities"]["urls"].extend(original_tweet["entities"]["urls"])
return quoted_tweet
def compose_followers_list(tweet, db, relative_times=True, show_screen_names=False):