diff options
author | Tollef Fog Heen <tfheen@err.no> | 2015-03-24 10:34:19 +0100 |
---|---|---|
committer | Tollef Fog Heen <tfheen@err.no> | 2015-03-24 10:34:19 +0100 |
commit | 60800f874bef343cd9871605c8e988ced1949e69 (patch) | |
tree | e47d21c813daae5c6d04b6df8a69ea61f4efacf3 /wee_slack.py | |
parent | 6506a1f2646e00854ed90f7d822ece9ffebc375e (diff) | |
download | wee-slack-60800f874bef343cd9871605c8e988ced1949e69.tar.gz |
Fix up formatting of join/part messages
Joins and parts are not messages said by the user, so format them otherwise.
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/wee_slack.py b/wee_slack.py index 3f04454..7298a8c 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -559,6 +559,8 @@ class Channel(SlackThing): tags = "notify_highlight" elif user != self.server.nick and self.name in self.server.users: tags = "notify_private,notify_message" + elif user in [w.prefix("join"), w.prefix("quit")]: + tags = "irc_smart_filter" else: tags = "notify_message" time_int = int(time_float) @@ -1239,6 +1241,10 @@ def process_message(message_json): append = "(deleted)" text = "" channel.buffer_prnt_changed(None, text, message_json["deleted_ts"], append) + elif message_json.get("subtype", "") == "channel_leave": + channel.buffer_prnt(w.prefix("quit").rstrip(), text, time) + elif message_json.get("subtype", "") == "channel_join": + channel.buffer_prnt(w.prefix("join").rstrip(), text, time) else: channel.buffer_prnt(name, text, time) except: |