Fix handling of commands (barring /me)

This commit is contained in:
Jaidyn Ann 2021-08-03 14:32:30 -05:00
parent 984f066070
commit 4cb52619aa

View File

@ -166,15 +166,14 @@ Conversation::ImMessage(BMessage* msg)
BString args = CommandArgs(body); BString args = CommandArgs(body);
ChatCommand* cmd = _GetServer()->CommandById(name, fLooper->GetInstance()); ChatCommand* cmd = _GetServer()->CommandById(name, fLooper->GetInstance());
if (cmd == NULL && name != "me") { if (cmd == NULL) {
if (name == "me")
fMessenger.SendMessage(msg);
else
_WarnUser(BString(B_TRANSLATE("That isn't a valid command. " _WarnUser(BString(B_TRANSLATE("That isn't a valid command. "
"Try /help for a list."))); "Try /help for a list.")));
break; break;
} }
else {
fMessenger.SendMessage(msg);
break;
}
BString error(""); BString error("");
if (cmd->Parse(args, &error, this) == false) if (cmd->Parse(args, &error, this) == false)