aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2020-05-21 01:54:22 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2020-05-22 23:52:15 +0200
commitf033db20e83a868e7ab41f8ac91b371ff6e9c5e6 (patch)
tree5eb26bc6913cd25a5f50d147c5e4b9f11b469ea8 /wee_slack.py
parent28b3398eb7d3b4a3bb5090ba65f603826eff8fcf (diff)
downloadwee-slack-f033db20e83a868e7ab41f8ac91b371ff6e9c5e6.tar.gz
Change name (i.e. full name) when renaming channel/thread buffer
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/wee_slack.py b/wee_slack.py
index e7cc55c..9acc9a9 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -1694,8 +1694,10 @@ class SlackChannel(SlackChannelCommon):
if self.channel_buffer:
if typing is None:
typing = self.is_someone_typing()
- new_name = self.formatted_name("sidebar", typing)
- w.buffer_set(self.channel_buffer, "short_name", new_name)
+ name = self.formatted_name("long_default", typing)
+ short_name = self.formatted_name("sidebar", typing)
+ w.buffer_set(self.channel_buffer, "name", name)
+ w.buffer_set(self.channel_buffer, "short_name", short_name)
def set_members(self, members):
self.members = set(members)
@@ -2111,8 +2113,11 @@ class SlackDMChannel(SlackChannel):
def rename(self, typing=None):
if self.channel_buffer:
- new_name = self.formatted_name(style="sidebar", present=self.team.is_user_present(self.user))
- w.buffer_set(self.channel_buffer, "short_name", new_name)
+ present = self.team.is_user_present(self.user)
+ name = self.formatted_name("long_default", typing, present)
+ short_name = self.formatted_name("sidebar", typing, present)
+ w.buffer_set(self.channel_buffer, "name", name)
+ w.buffer_set(self.channel_buffer, "short_name", short_name)
class SlackGroupChannel(SlackChannel):
@@ -2326,6 +2331,7 @@ class SlackThreadChannel(SlackChannelCommon):
def rename(self):
if self.channel_buffer and not self.label:
+ w.buffer_set(self.channel_buffer, "name", self.formatted_name(style="long_default"))
w.buffer_set(self.channel_buffer, "short_name", self.formatted_name(style="sidebar"))
def set_highlights(self, highlight_string=None):