diff options
author | Ryan Huber <rhuber@gmail.com> | 2014-10-25 16:14:47 -0700 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2014-10-25 16:14:47 -0700 |
commit | c7b62835af2c72131a111c253d889561eb3f4819 (patch) | |
tree | 53b1bbeaec97d4b893c751a4ef1a5d3e3ad84ef1 /wee_slack.py | |
parent | c22e73e19280ab3dd5283fbcaddf35daa2db0c4f (diff) | |
download | wee-slack-c7b62835af2c72131a111c253d889561eb3f4819.tar.gz |
notify fix so private messages are correct
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/wee_slack.py b/wee_slack.py index 5964c79..ea2a493 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -374,6 +374,19 @@ class DmChannel(Channel): else: new_name = self.name w.buffer_set(self.channel_buffer, "short_name", color + new_name) + def prnt(self, user='unknown user', message='no message', time=0, backlog=False): + message = message.encode('ascii', 'ignore') + if backlog == True or (time != 0 and self.last_read > time): + tags = "no_highlight,notify_none,logger_backlog_end" + elif message.find(self.server.nick) > -1: + tags = "notify_highlight" + else: + tags = "notify_private,notify_message" + time = int(float(time)) + if self.channel_buffer: + w.prnt_date_tags(self.channel_buffer, time, tags, "%s\t%s" % (user, message)) + else: + pass class User(SlackThing): def __init__(self, server, name, identifier, presence="away"): |