From 6b78e94a4637c10644a0472159d7abe1dd7a0490 Mon Sep 17 00:00:00 2001 From: Tomas Janousek Date: Tue, 15 Jan 2019 18:01:12 +0100 Subject: Resolve references in topic When a user is mentioned in a topic, it's only resolved in the 15:47:34 <--> @someone set the channel topic: blah blah @mention blah message. The buffer title, however, reads: blah blah <@JHDJFHKDW> blah --- wee_slack.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'wee_slack.py') diff --git a/wee_slack.py b/wee_slack.py index 35b33c1..2e94222 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -1461,6 +1461,7 @@ class SlackChannel(SlackChannelCommon): topic = self.topic['value'] if topic == "": topic = self.slack_purpose['value'] + topic = unhtmlescape(unfurl_refs(topic, ignore_alt_text=False)) w.buffer_set(self.channel_buffer, "title", topic) def set_topic(self, value): @@ -2726,7 +2727,7 @@ def subprocess_message_deleted(message_json, eventrouter, channel, team): def subprocess_channel_topic(message_json, eventrouter, channel, team): text = unhtmlescape(unfurl_refs(message_json["text"], ignore_alt_text=False)) channel.buffer_prnt(w.prefix("network").rstrip(), text, message_json["ts"], tagset="topic") - channel.set_topic(unhtmlescape(message_json["topic"])) + channel.set_topic(message_json["topic"]) def process_reply(message_json, eventrouter, **kwargs): -- cgit