aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Huber <rhuber@gmail.com>2015-11-17 10:37:06 -0800
committerRyan Huber <rhuber@gmail.com>2015-11-17 10:37:06 -0800
commitd6652aec633db0e5e5a78fb2f7d211b8b4e8c96a (patch)
treedd6a6e5cb9ef48f503199e81b6792eded827c2b2
parentddce59c47ced37a4d68d90bfb147405588b3f488 (diff)
parent10a9f5e73e18c060a9495f479c1e837ddaf66230 (diff)
downloadwee-slack-d6652aec633db0e5e5a78fb2f7d211b8b4e8c96a.tar.gz
Merge pull request #113 from rawdigits/respect-prefix-same-nick
Respect weechat.look.prefix_same_nick setting
-rw-r--r--wee_slack.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 6e1b465..d55a50e 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -352,6 +352,7 @@ class Channel(object):
self.last_received = None
self.messages = []
self.scrolling = False
+ self.last_active_user = None
self.muted = False
if active:
self.create_buffer()
@@ -590,10 +591,17 @@ class Channel(object):
#tags += ",no_log"
time_int = int(time_float)
if self.channel_buffer:
- if self.server.users.find(user):
- name = self.server.users.find(user).formatted_name()
+ prefix_same_nick = w.config_string(w.config_get('weechat.look.prefix_same_nick'))
+ if user == self.last_active_user and prefix_same_nick != "":
+ name = prefix_same_nick
else:
- name = user
+ if self.server.users.find(user):
+ name = self.server.users.find(user).formatted_name()
+ self.last_active_user = user
+ # XXX: handle bots properly here.
+ else:
+ name = user
+ self.last_active_user = None
name = name.decode('utf-8')
#colorize nicks in each line
chat_color = w.config_string(w.config_get('weechat.color.chat'))