integrations: Change Slack private channel mention string.

In Slack webhook integration setup, the only scenario where a message
payload contains a channel mention without the channels name is when the
user mentions a private channel.
  e.g <#C07AVLQ3AUQ|>

This commit updates the string we use for such mention to "private Slack
channel" for better clarity.
This commit is contained in:
PieterCK
2024-12-23 14:41:02 +07:00
committed by Alex Vandiver
parent 059782bb9f
commit f89881d843

View File

@@ -79,7 +79,9 @@ def convert_slack_user_and_channel_mentions(text: str, app_token: str) -> str:
# a mention isn't triggered for a Zulip channel with the same name.
channel_info: list[str] = slack_channelmention_match.group(0).split("|")
channel_name = channel_info[1]
tokens[iterator] = f"**#{channel_name}**" if channel_name else "**#[private channel]**"
tokens[iterator] = (
f"**#{channel_name}**" if channel_name else "**#[private Slack channel]**"
)
text = " ".join(tokens)
return text