aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/chat_input
diff options
context:
space:
mode:
authorjugendhacker <j.r@jugendhacker.de>2022-01-05 12:35:46 +0100
committerGitHub <noreply@github.com>2022-01-05 12:35:46 +0100
commitb3d452265fce5d65d80cc7191747d8a574bbc25d (patch)
tree8300c377f524556c7bd793c383c52df800843ea5 /main/src/ui/chat_input
parentf422734cc8ce34d34be739e4f1a0a47ccdbf9e11 (diff)
downloaddino-b3d452265fce5d65d80cc7191747d8a574bbc25d.tar.gz
dino-b3d452265fce5d65d80cc7191747d8a574bbc25d.zip
Allow spaces in nick for affiliate command (#1170)
Diffstat (limited to 'main/src/ui/chat_input')
-rw-r--r--main/src/ui/chat_input/chat_input_controller.vala8
1 files changed, 5 insertions, 3 deletions
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;