Added new commands: /MSG /QUOTE /RAW

master
Tomatix 5 years ago
parent 521a4a7f7c
commit 468ee3c0dd
  1. 3
      ICommand/Commands.h
  2. 21
      ICommand/ICommand.cpp

@ -30,6 +30,9 @@ namespace Command::Internal {
constexpr auto* MUTERESP = "MUTERESP";
constexpr auto* UNMUTERESP = "UNMUTERESP";
constexpr auto* CLEAR = "CLEAR";
constexpr auto* MSG = "MSG";
constexpr auto* QUOTE = "QUOTE";
constexpr auto* RAW = "RAW";
}
#endif // ICOMMAND_COMMANDS_H

@ -225,7 +225,7 @@ bool ICommand::tryParseIRC(QString cmdLine)
return true;
}
else if (command == PRIVMSG) {
else if (command == PRIVMSG || command == Command::Internal::MSG) {
CommandData argv(cmdLine, { &ICommand::prd_AnyWord, &ICommand::prd_Message });
if (!connection.isOnline())
print_notConnectedToServer(command);
@ -553,6 +553,25 @@ bool ICommand::tryParseInternal(QString cmdLine)
return true;
}
else if (command == QUOTE || command == RAW) {
CommandData argv(cmdLine, { &ICommand::prd_Message });
if (!argv[0]) {
print_notEnoughParameters(command);
return true;
}
// don't do "isOnline" since BNCs asks to do "/quote pass blah" and such before connection registration.
// ... as well as other services that would require something similar.
if (!connection.isConnected()) {
print_notConnectedToServer(command);
return true;
}
connection.raw(*argv[0]);
return true;
}
return false;
}

Loading…
Cancel
Save