diff options
-rw-r--r-- | slack/config.py | 7 | ||||
-rw-r--r-- | slack/slack_user.py | 6 |
2 files changed, 11 insertions, 2 deletions
diff --git a/slack/config.py b/slack/config.py index e7d9937..38a069b 100644 --- a/slack/config.py +++ b/slack/config.py @@ -187,6 +187,13 @@ class SlackConfigSectionLook: string_values=["emoji", "name", "both"], ) + self.replace_space_in_nicks_with = WeeChatOption( + self._section, + "replace_space_in_nicks_with", + "", + "", + ) + self.typing_status_nicks = WeeChatOption( self._section, "typing_status_nicks", diff --git a/slack/slack_user.py b/slack/slack_user.py index 98d6170..6c9d169 100644 --- a/slack/slack_user.py +++ b/slack/slack_user.py @@ -32,11 +32,13 @@ def _name_from_user_info(workspace: SlackWorkspace, info: SlackUserInfo) -> str: def name_from_user_info_without_spaces( workspace: SlackWorkspace, info: SlackUserInfo ) -> str: - return _name_from_user_info(workspace, info).replace(" ", "") + return _name_from_user_info(workspace, info).replace( + " ", shared.config.look.replace_space_in_nicks_with.value + ) def format_bot_nick(nick: str, colorize: bool = False, only_nick: bool = False) -> str: - nick = nick.replace(" ", "") + nick = nick.replace(" ", shared.config.look.replace_space_in_nicks_with.value) if colorize: nick = with_color(nick_color(nick), nick) |