aboutsummaryrefslogtreecommitdiffstats
path: root/slack/commands.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2024-01-09 20:04:21 +0100
committerTrygve Aaberge <trygveaa@gmail.com>2024-02-18 11:32:55 +0100
commit9e79cdf74f2d04a35332859940e4446e6c979b50 (patch)
treed4b651b60deb65eeb127dd732ba08f3d05264a19 /slack/commands.py
parent616bb0537859b3d95a29205fdd167ebadac2b9bd (diff)
downloadwee-slack-9e79cdf74f2d04a35332859940e4446e6c979b50.tar.gz
Handle messages without a user field
This can happen in channels shared between workspaces if one of the workspaces are removed. Then messages from users in that workspace will not have a user field anymore, but instead a user_profile field.
Diffstat (limited to 'slack/commands.py')
-rw-r--r--slack/commands.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/slack/commands.py b/slack/commands.py
index 7638b0d..52a1f51 100644
--- a/slack/commands.py
+++ b/slack/commands.py
@@ -17,7 +17,7 @@ from slack.shared import MESSAGE_ID_REGEX_STRING, REACTION_CHANGE_REGEX_STRING,
from slack.slack_buffer import SlackBuffer
from slack.slack_conversation import SlackConversation
from slack.slack_thread import SlackThread
-from slack.slack_user import name_from_user_info_without_spaces
+from slack.slack_user import format_user_nick, name_from_user_info
from slack.slack_workspace import SlackWorkspace
from slack.task import run_async, sleep
from slack.util import get_callback_name, with_color
@@ -608,7 +608,7 @@ async def complete_user_next(
slack_buffer.completion_context = "ACTIVE_COMPLETION"
suffix = nick_suffix() if is_first_word else " "
slack_buffer.completion_values = [
- name_from_user_info_without_spaces(slack_buffer.workspace, user) + suffix
+ format_user_nick(name_from_user_info(slack_buffer.workspace, user)) + suffix
for user in search["results"]
]
slack_buffer.completion_index = 0