mirror of
https://github.com/TakeV-Lambda/dino.git
synced 2024-11-23 07:24:35 +00:00
Fix when /affiliate cmd doesn't get enough args (#557)
Added array bounds checking to /affiliate command parsing. Maybe some user feedback when using the different commands would be useful.
This commit is contained in:
parent
97c59cb8cd
commit
f4778ef3e6
1 changed files with 6 additions and 2 deletions
|
@ -112,8 +112,12 @@ public class View : Box {
|
|||
stream_interactor.get_module(MucManager.IDENTITY).kick(conversation.account, conversation.counterpart, token[1]);
|
||||
return;
|
||||
case "/affiliate":
|
||||
string[] user_role = token[1].split(" ", 2);
|
||||
stream_interactor.get_module(MucManager.IDENTITY).change_affiliation(conversation.account, conversation.counterpart, user_role[0].strip(), user_role[1].strip());
|
||||
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());
|
||||
}
|
||||
}
|
||||
return;
|
||||
case "/nick":
|
||||
stream_interactor.get_module(MucManager.IDENTITY).change_nick(conversation.account, conversation.counterpart, token[1]);
|
||||
|
|
Loading…
Reference in a new issue