Change prefix when switch to public or mine stream
[rainbowstream.git] / rainbowstream / rainbow.py
index f684ac4ed3a6ea38404e98167e6b7ee1031325b9..bd421d24664cef082e715038b63dcd8fe41182b7 100644 (file)
@@ -1195,6 +1195,8 @@ def switch():
             # Kill old thread
             g['stream_stop'] = True
             args.track_keywords = keyword
+            # Set prefix to origin name with public
+            g['PREFIX'] = '@' + g['original_name'] + '/public'
             # Start new thread
             th = threading.Thread(
                 target=stream,
@@ -1207,6 +1209,8 @@ def switch():
         elif target == 'mine':
             # Kill old thread
             g['stream_stop'] = True
+            # Set prefix to origin name
+            g['PREFIX'] = '@' + g['original_name']
             # Start new thread
             th = threading.Thread(
                 target=stream,
@@ -1220,7 +1224,7 @@ def switch():
         elif target == 'list':
             owner, slug = get_slug()
             # Force python 2 not redraw readline buffer
-            g['cmd'] = '/'.join([owner, slug])
+            g['PREFIX'] = g['cmd'] = '/'.join([owner, slug])
             printNicely(light_yellow('getting list members ...'))
             # Get members
             t = Twitter(auth=authen())