refactor: add Channel::addSystemMessage function (#5500)
This commit is contained in:
+9
-11
@@ -1,6 +1,7 @@
|
||||
#include "Application.hpp"
|
||||
|
||||
#include "common/Args.hpp"
|
||||
#include "common/Channel.hpp"
|
||||
#include "common/QLogging.hpp"
|
||||
#include "common/Version.hpp"
|
||||
#include "controllers/accounts/AccountController.hpp"
|
||||
@@ -233,10 +234,10 @@ void Application::initialize(Settings &settings, const Paths &paths)
|
||||
{
|
||||
if (auto channel = split->getChannel(); !channel->isEmpty())
|
||||
{
|
||||
channel->addMessage(makeSystemMessage(
|
||||
channel->addSystemMessage(
|
||||
"Chatterino unexpectedly crashed and restarted. "
|
||||
"You can disable automatic restarts in the "
|
||||
"settings."));
|
||||
"settings.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -584,9 +585,8 @@ void Application::initPubSub()
|
||||
QString text =
|
||||
QString("%1 cleared the chat.").arg(action.source.login);
|
||||
|
||||
auto msg = makeSystemMessage(text);
|
||||
postToThread([chan, msg] {
|
||||
chan->addMessage(msg);
|
||||
postToThread([chan, text] {
|
||||
chan->addSystemMessage(text);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -610,9 +610,8 @@ void Application::initPubSub()
|
||||
text += QString(" (%1 seconds)").arg(action.duration);
|
||||
}
|
||||
|
||||
auto msg = makeSystemMessage(text);
|
||||
postToThread([chan, msg] {
|
||||
chan->addMessage(msg);
|
||||
postToThread([chan, text] {
|
||||
chan->addSystemMessage(text);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -631,9 +630,8 @@ void Application::initPubSub()
|
||||
(action.modded ? "modded" : "unmodded"),
|
||||
action.target.login);
|
||||
|
||||
auto msg = makeSystemMessage(text);
|
||||
postToThread([chan, msg] {
|
||||
chan->addMessage(msg);
|
||||
postToThread([chan, text] {
|
||||
chan->addSystemMessage(text);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user