enabled tweet chains. see issue #163
authorb3yond <b3yond@riseup.net>
Thu, 8 Dec 2016 09:47:13 +0000 (10:47 +0100)
committerGitHub <noreply@github.com>
Thu, 8 Dec 2016 09:47:13 +0000 (10:47 +0100)
If the user wants to reply themself, their @handle is not included in the tweet string.

rainbowstream/rainbow.py

index 1b5ee1d..024e51b 100644 (file)
@@ -618,7 +618,12 @@ def reply():
     tid = c['tweet_dict'][id]
     user = t.statuses.show(id=tid)['user']['screen_name']
     status = ' '.join(g['stuff'].split()[1:])
-    status = '@' + user + ' ' + str2u(status)
+    # don't include own username for tweet chains
+    # for details see issue https://github.com/DTVD/rainbowstream/issues/163
+    if user == g['original_name']:
+        status = str2u(status)
+    else:
+        status = '@' + user + ' ' + str2u(status)
     t.statuses.update(status=status, in_reply_to_status_id=tid)