aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolf480pl <wolf480@interia.pl>2017-02-22 15:29:40 +0100
committerWolf480pl <wolf480@interia.pl>2017-02-22 16:42:58 +0100
commit429dfedb0403a9ec51af171513b5b3d9fbe8f1a6 (patch)
tree3ba7bf5f108d07461d3d44c13d7f1b68b36fe946
parentdc5097c8b3b6a82442c6d5637a62a946b4dfc21c (diff)
downloadwee-slack-429dfedb0403a9ec51af171513b5b3d9fbe8f1a6.tar.gz
Set the thread channel's topic to the parent message
-rw-r--r--wee_slack.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 05f4785..a74dab4 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -1565,6 +1565,10 @@ class SlackThreadChannel(object):
w.buffer_set(self.channel_buffer, "localvar_set_type", 'channel')
w.buffer_set(self.channel_buffer, "localvar_set_channel", self.formatted_name())
w.buffer_set(self.channel_buffer, "short_name", self.formatted_name(style="sidebar", enable_color=True))
+ time_format = w.config_string(w.config_get("weechat.look.buffer_time_format"))
+ parent_time = time.localtime(SlackTS(self.parent_message.ts).major)
+ topic = '{} {} | {}'.format(time.strftime(time_format, parent_time), self.parent_message.sender, self.parent_message.render() )
+ w.buffer_set(self.channel_buffer, "title", topic.encode('utf-8'))
#self.eventrouter.weechat_controller.set_refresh_buffer_list(True)