|
|
|
@ -693,9 +693,24 @@ void IRC::onMsgNumeric(const IRCPrefix& /*sender*/, const std::string& num, cons |
|
|
|
|
|
|
|
|
|
void IRC::onMsgCTCPRequest(const IRCPrefix& sender, const std::string& target, const std::string& command, const std::string& message) |
|
|
|
|
{ |
|
|
|
|
if (!ignoreVerbosity(Command::Internal::CTCP)) { |
|
|
|
|
const std::string& chantypes = isupport().at("CHANTYPES"); |
|
|
|
|
|
|
|
|
|
if (command == "ACTION") { |
|
|
|
|
auto msg = fmt::format("{} {}", sender.toString(), message); |
|
|
|
|
IWin* win = MdiManager::instance().findWindow(&getStatus(), QString::fromStdString(target)); |
|
|
|
|
if (!win) { |
|
|
|
|
if (std::find(chantypes.begin(), chantypes.end(), target[0]) == chantypes.end()) |
|
|
|
|
win = getStatus().createPrivateWindow(QString::fromStdString(sender.toString()), false); |
|
|
|
|
else { |
|
|
|
|
msg = fmt::format("({}) {} {}", target, sender.toString(), message); |
|
|
|
|
win = &getStatus(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
win->print(PrintType::Action, msg.c_str()); |
|
|
|
|
} |
|
|
|
|
else if (!ignoreVerbosity(Command::Internal::CTCP)) { |
|
|
|
|
std::string msg; |
|
|
|
|
const std::string& chantypes = isupport().at("CHANTYPES"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Sent private */ |
|
|
|
|
if (std::find(chantypes.begin(), chantypes.end(), target[0]) == chantypes.end()) { |
|
|
|
|