diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2020-02-20 22:51:32 +0100 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2020-02-20 22:51:32 +0100 |
commit | cc6459415bbf117353564cc709da0343434dcf23 (patch) | |
tree | 63d6ff15fb45fb57148a3d6cc2f896dd26ad178b /wee_slack.py | |
parent | 6c07fb93e5c0ea8e481bebce4664bc4bfb28ac1f (diff) | |
download | wee-slack-cc6459415bbf117353564cc709da0343434dcf23.tar.gz |
Remove ignore_alt_text parameter from unfurl_refs
This is only used in tests and in render_topic, and I don't see why
render_topic shouldn't follow the global config that is set.
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/wee_slack.py b/wee_slack.py index 889c53e..b081a03 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -1692,7 +1692,7 @@ class SlackChannel(SlackChannelCommon): topic = self.topic['value'] if not topic and fallback_to_purpose: topic = self.slack_purpose['value'] - return unhtmlescape(unfurl_refs(topic, ignore_alt_text=False)) + return unhtmlescape(unfurl_refs(topic)) def set_topic(self, value=None): if value is not None: @@ -3421,7 +3421,7 @@ def unfurl_block_element(text): return "{} ({})".format(text["image_url"], text["alt_text"]) -def unfurl_refs(text, ignore_alt_text=None): +def unfurl_refs(text): """ input : <@U096Q7CQM|someuser> has joined the channel ouput : someuser has joined the channel @@ -3433,15 +3433,12 @@ def unfurl_refs(text, ignore_alt_text=None): # - <!subteam^U2147483697|@group> # Test patterns lives in ./_pytest/test_unfurl.py - if ignore_alt_text is None: - ignore_alt_text = config.unfurl_ignore_alt_text - def unfurl_ref(match): ref = match.group(1) id = ref.split('|')[0] display_text = ref if ref.find('|') > -1: - if ignore_alt_text: + if config.unfurl_ignore_alt_text: display_text = resolve_ref(id) else: if id.startswith("#"): |