aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Huber <rhuber@gmail.com>2015-06-10 08:46:53 -0700
committerRyan Huber <rhuber@gmail.com>2015-06-10 08:46:53 -0700
commitc32aa8092f54f398958c07713e04f0f8234f12bd (patch)
tree58280f25b66e582c0f9d025034866c71564c6a4c
parent0261f580ef20674b05bdcab312baa846ab2b3693 (diff)
parent2aba0ca7eaec29b0834283911d05792086b73819 (diff)
downloadwee-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.py8
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: