Allow spaces in nick for affiliate command (#1170)

This commit is contained in:
jugendhacker 2022-01-05 12:35:46 +01:00 committed by GitHub
parent f422734cc8
commit b3d452265f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -122,9 +122,11 @@ public class ChatInputController : Object {
return; return;
case "/affiliate": case "/affiliate":
if (token.length > 1) { if (token.length > 1) {
string[] user_role = token[1].split(" ", 2); string[] user_role = token[1].split(" ");
if (user_role.length == 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 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; return;