From b3d452265fce5d65d80cc7191747d8a574bbc25d Mon Sep 17 00:00:00 2001 From: jugendhacker Date: Wed, 5 Jan 2022 12:35:46 +0100 Subject: Allow spaces in nick for affiliate command (#1170) --- main/src/ui/chat_input/chat_input_controller.vala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'main/src') diff --git a/main/src/ui/chat_input/chat_input_controller.vala b/main/src/ui/chat_input/chat_input_controller.vala index eeaddaab..d7a69c3d 100644 --- a/main/src/ui/chat_input/chat_input_controller.vala +++ b/main/src/ui/chat_input/chat_input_controller.vala @@ -122,9 +122,11 @@ public class ChatInputController : Object { return; case "/affiliate": if (token.length > 1) { - string[] user_role = token[1].split(" ", 2); - if (user_role.length == 2) { - stream_interactor.get_module(MucManager.IDENTITY).change_affiliation(conversation.account, conversation.counterpart, user_role[0].strip(), user_role[1].strip()); + string[] user_role = token[1].split(" "); + if (user_role.length >= 2) { + string nick = string.joinv(" ", user_role[0:user_role.length - 1]).strip(); + string role = user_role[user_role.length - 1].strip(); + stream_interactor.get_module(MucManager.IDENTITY).change_affiliation(conversation.account, conversation.counterpart, nick, role); } } return; -- cgit v1.2.3-70-g09d2