Add remaining pubsub messages to chat
This commit is contained in:
@@ -212,6 +212,7 @@ void IrcMessageHandler::handleModeMessage(Communi::IrcMessage *message)
|
||||
|
||||
void IrcMessageHandler::handleNoticeMessage(Communi::IrcNoticeMessage *message)
|
||||
{
|
||||
return;
|
||||
auto app = getApp();
|
||||
MessagePtr msg = Message::createSystemMessage(message->content());
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ PubSub::PubSub()
|
||||
|
||||
bool ok;
|
||||
|
||||
action.args.duration = QString(durationArg.GetString()).toUInt(&ok, 10);
|
||||
action.duration = QString(durationArg.GetString()).toUInt(&ok, 10);
|
||||
|
||||
this->sig.moderation.modeChanged.invoke(action);
|
||||
};
|
||||
@@ -290,6 +290,21 @@ PubSub::PubSub()
|
||||
ModerationStateAction action(data, roomID);
|
||||
|
||||
getTargetUser(data, action.target);
|
||||
|
||||
try {
|
||||
const auto &args = getArgs(data);
|
||||
|
||||
if (args.Size() < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!rj::getSafe(args[0], action.target.name)) {
|
||||
return;
|
||||
}
|
||||
} catch (const std::runtime_error &ex) {
|
||||
debug::Log("Error parsing moderation action: {}", ex.what());
|
||||
}
|
||||
|
||||
action.modded = false;
|
||||
|
||||
this->sig.moderation.moderationStateChanged.invoke(action);
|
||||
@@ -299,6 +314,21 @@ PubSub::PubSub()
|
||||
ModerationStateAction action(data, roomID);
|
||||
|
||||
getTargetUser(data, action.target);
|
||||
|
||||
try {
|
||||
const auto &args = getArgs(data);
|
||||
|
||||
if (args.Size() < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!rj::getSafe(args[0], action.target.name)) {
|
||||
return;
|
||||
}
|
||||
} catch (const std::runtime_error &ex) {
|
||||
debug::Log("Error parsing moderation action: {}", ex.what());
|
||||
}
|
||||
|
||||
action.modded = true;
|
||||
|
||||
this->sig.moderation.moderationStateChanged.invoke(action);
|
||||
|
||||
@@ -41,9 +41,23 @@ struct ModeChangedAction : PubSubAction {
|
||||
On,
|
||||
} state;
|
||||
|
||||
union {
|
||||
uint32_t duration;
|
||||
} args;
|
||||
uint32_t duration = 0;
|
||||
|
||||
const char *getModeName() const
|
||||
{
|
||||
switch (this->mode) {
|
||||
case Mode::Slow:
|
||||
return "slow";
|
||||
case Mode::R9K:
|
||||
return "r9k";
|
||||
case Mode::SubscribersOnly:
|
||||
return "subscribers-only";
|
||||
case Mode::EmoteOnly:
|
||||
return "emote-only";
|
||||
default:
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
struct BanAction : PubSubAction {
|
||||
|
||||
Reference in New Issue
Block a user