public override bool Command(CommandModel command)
{
bool handled = false;
if (IsConnected) {
if (command.IsCommand) {
switch (command.Command) {
case "help":
CommandHelp(command);
handled = true;
break;
case "msg":
case "query":
CommandMessageQuery(command);
handled = true;
break;
case "me":
CommandMe(command);
handled = true;
break;
case "say":
CommandSay(command);
handled = true;
break;
case "joinas":
CommandJoinAs(command);
handled = true;
break;
case "join":
CommandJoin(command);
handled = true;
break;
case "invite":
CommandInvite(command);
handled = true;
break;
case "part":
case "leave":
CommandPart(command);
handled = true;
break;
case "away":
CommandAway(command);
handled = true;
break;
case "roster":
CommandRoster(command);
handled = true;
break;
case "contact":
CommandContact(command);
handled = true;
break;
case "priority":
CommandPriority(command);
handled = true;
break;
case "whois":
CommandWhoIs(command);
handled = true;
break;
case "register":
CommandRegister(command);
handled = true;
break;
}
} else {
_Say(command.Chat, command.Data);
handled = true;
}
} else {
if (command.IsCommand) {
// commands which work even without being connected
switch (command.Command) {
case "help":
CommandHelp(command);
handled = true;
break;
case "connect":
CommandConnect(command);
handled = true;
break;
}
} else {
// normal text, without connection
NotConnected(command);
handled = true;
}
}
return handled;
}