diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2019-04-11 12:41:48 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2019-06-02 23:09:20 +0200 |
commit | 68244ea9f5118c1e32a67f117c6a2c32755f4f16 (patch) | |
tree | 66563a357f7657f9303c5113d3ce6ad2004d7dec | |
parent | dd8af07d945e5bf0862dc14740349917ffdddfbd (diff) | |
download | wee-slack-68244ea9f5118c1e32a67f117c6a2c32755f4f16.tar.gz |
Separate the tags for join and leave
Replace irc_smart_filter with irc_join and irc_part. There is no
smartness implemented, so irc_smart_tag shouldn't be set.
-rw-r--r-- | wee_slack.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/wee_slack.py b/wee_slack.py index 624c411..d20bc45 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -2844,14 +2844,14 @@ def subprocess_thread_message(message_json, eventrouter, channel, team): def subprocess_channel_join(message_json, eventrouter, channel, team): joinprefix = w.prefix("join").strip() message = SlackMessage(message_json, team, channel, override_sender=joinprefix) - channel.buffer_prnt(joinprefix, channel.render(message), message_json["ts"], tagset='joinleave') + channel.buffer_prnt(joinprefix, channel.render(message), message_json["ts"], tagset='join') channel.user_joined(message_json['user']) def subprocess_channel_leave(message_json, eventrouter, channel, team): leaveprefix = w.prefix("quit").strip() message = SlackMessage(message_json, team, channel, override_sender=leaveprefix) - channel.buffer_prnt(leaveprefix, channel.render(message), message_json["ts"], tagset='joinleave') + channel.buffer_prnt(leaveprefix, channel.render(message), message_json["ts"], tagset='leave') channel.user_left(message_json['user']) # channel.update_nicklist(message_json['user']) # channel.update_nicklist() @@ -3390,16 +3390,12 @@ def format_nick(nick, previous_nick=None): def tag(tagset, user=None, self_msg=False, backlog=False): tagsets = { - # messages in the team/server buffer, e.g. "new channel created" "team_info": {"no_highlight", "log3"}, "team_message": {"irc_privmsg", "notify_message", "log1"}, - # when receiving a direct message "dm": {"irc_privmsg", "notify_private", "log1"}, - # when this is a join/leave, attach for smart filter ala: - # if user in [x.strip() for x in w.prefix("join"), w.prefix("quit")] - "joinleave": {"irc_smart_filter", "no_highlight", "log4"}, + "join": {"irc_join", "no_highlight", "log4"}, + "leave": {"irc_part", "no_highlight", "log4"}, "topic": {"irc_topic", "no_highlight", "log3"}, - # catchall ? "default": {"irc_privmsg", "notify_message", "log1"}, } nick_tag = {"nick_{}".format(user or "unknown").replace(" ", "_")} |