diff options
author | David Vo <auscompgeek@users.noreply.github.com> | 2017-07-28 14:03:31 +1000 |
---|---|---|
committer | David Vo <auscompgeek@users.noreply.github.com> | 2017-09-27 17:09:23 +1000 |
commit | 2c7eb4131e73a86cab6bcb4821e5ee64cedd260d (patch) | |
tree | 76138917263c61d48dae033cf2aa30d98b52497c | |
parent | 68f8f1e1b926fa47e4363f32e23932084dcea9a2 (diff) | |
download | wee-slack-2c7eb4131e73a86cab6bcb4821e5ee64cedd260d.tar.gz |
SlackMPDMChannel: Refactor name adjustment
-rw-r--r-- | wee_slack.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py index aa19a01..01aa5a2 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -1675,11 +1675,15 @@ class SlackMPDMChannel(SlackChannel): self.eventrouter.receive(s) # self.create_buffer() + @staticmethod + def adjust_name(n): + return "|".join("-".join(n.split("-")[1:-1]).split("--")) + def set_name(self, n): - self.name = "|".join("-".join(n.split("-")[1:-1]).split("--")) + self.name = self.adjust_name(n) def formatted_name(self, style="default", typing=False, **kwargs): - adjusted_name = "|".join("-".join(self.slack_name.split("-")[1:-1]).split("--")) + adjusted_name = self.adjust_name(self.slack_name) if config.channel_name_typing_indicator: if not typing: prepend = "#" |