Merge pull request #209 from Lertsenem/pr-lsratelimit
authorOrakaro <DTVD@users.noreply.github.com>
Sun, 11 Dec 2016 13:25:58 +0000 (22:25 +0900)
committerGitHub <noreply@github.com>
Sun, 11 Dec 2016 13:25:58 +0000 (22:25 +0900)
Avoid 'Rate limit exceeded' error on 'ls' command

rainbowstream/rainbow.py

index e0668c3..118667c 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)