diff options
author | Ryan Huber <rhuber@gmail.com> | 2015-06-10 08:46:53 -0700 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2015-06-10 08:46:53 -0700 |
commit | c32aa8092f54f398958c07713e04f0f8234f12bd (patch) | |
tree | 58280f25b66e582c0f9d025034866c71564c6a4c | |
parent | 0261f580ef20674b05bdcab312baa846ab2b3693 (diff) | |
parent | 2aba0ca7eaec29b0834283911d05792086b73819 (diff) | |
download | wee-slack-c32aa8092f54f398958c07713e04f0f8234f12bd.tar.gz |
Merge pull request #55 from tfheen/join-leave-fixup
Fix up formatting of join/part/topic messages
-rw-r--r-- | wee_slack.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/wee_slack.py b/wee_slack.py index 05a39e0..467a29c 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -581,6 +581,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) @@ -1275,6 +1277,12 @@ 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) + elif message_json.get("subtype", "") == "channel_topic": + channel.buffer_prnt(w.prefix("network").rstrip(), text, time) else: channel.buffer_prnt(name, text, time) except: |