diff options
author | Ryan Huber <rhuber@gmail.com> | 2014-10-27 21:57:37 -0700 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2014-10-27 21:57:37 -0700 |
commit | 82168a36c6725bc586fc01c6d70474233d974711 (patch) | |
tree | d728eb38c895b22128c46257924c0ab1df73a644 /wee_slack.py | |
parent | 03acf12d39cb4e186ab4544f576105c5515166bb (diff) | |
download | wee-slack-82168a36c6725bc586fc01c6d70474233d974711.tar.gz |
handle commas properly
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/wee_slack.py b/wee_slack.py index 45483d1..a47f96f 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -378,8 +378,6 @@ class Channel(SlackThing): #w.buffer_set(self.weechat_buffer, "short_name", new_name) w.buffer_set(self.channel_buffer, "short_name", new_name) def buffer_prnt(self, user='unknown user', message='no message', time=0): - if self.server.users.find(user) and user != self.server.nick: - user = self.server.users.find(user).colorized_name() set_read_marker = False time = float(time) message = message.encode('ascii', 'ignore') @@ -388,13 +386,17 @@ class Channel(SlackThing): set_read_marker = True elif message.find(self.server.nick) > -1: tags = "notify_highlight" - elif self.name in self.server.users: + elif user != self.server.nick and self.name in self.server.users: tags = "notify_private,notify_message" else: tags = "notify_message" time = int(float(time)) if self.channel_buffer: - w.prnt_date_tags(self.channel_buffer, time, tags, "%s\t%s" % (user, message)) + if self.server.users.find(user) and user != self.server.nick: + colorized_name = self.server.users.find(user).colorized_name() + else: + colorized_name = user + w.prnt_date_tags(self.channel_buffer, time, tags, "%s\t%s" % (colorized_name, message)) if set_read_marker: self.mark_read(False) else: @@ -724,6 +726,8 @@ def process_message(message_json): #clean up tweets text = re.sub("<.*?\\|(.*?)>", "\\1", text) + text = text.replace('\t', ' ') + #first figure out the name if message_json.has_key('user'): name = server.users.find(message_json['user']).name |