mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Add a scrappy timeout message from pubsub in channels now
Progress on #323
This commit is contained in:
parent
92a19d61cf
commit
1edcfe5219
1 changed files with 17 additions and 0 deletions
|
@ -65,6 +65,23 @@ Application::Application()
|
|||
});
|
||||
|
||||
pubsub.sig.moderation.userTimedOut.connect([&](const auto &action) {
|
||||
auto &server = providers::twitch::TwitchServer::getInstance();
|
||||
auto chan = server.getChannelOrEmptyByID(action.roomID);
|
||||
|
||||
if (chan->isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto msg = messages::Message::createSystemMessage(
|
||||
QString("User %1(%2) was timed out by %3 for %4 seconds with reason: '%5'")
|
||||
.arg(action.target.name)
|
||||
.arg(action.target.id)
|
||||
.arg(action.source.name)
|
||||
.arg(action.duration)
|
||||
.arg(action.reason));
|
||||
|
||||
chan->addMessage(msg);
|
||||
|
||||
debug::Log("User {}({}) was timed out by {} for {} seconds with reason: '{}'",
|
||||
action.target.name, action.target.id, action.source.name, action.duration,
|
||||
action.reason);
|
||||
|
|
Loading…
Reference in a new issue