Made username and color in AutoMod mod messages use correct values (#2967)
We use values given in pubsub messages and handle their edge-cases properly.
This commit is contained in:
+7
-14
@@ -207,7 +207,7 @@ void Application::initPubsub()
|
||||
}
|
||||
|
||||
QString text =
|
||||
QString("%1 cleared the chat").arg(action.source.name);
|
||||
QString("%1 cleared the chat").arg(action.source.login);
|
||||
|
||||
auto msg = makeSystemMessage(text);
|
||||
postToThread([chan, msg] {
|
||||
@@ -226,15 +226,14 @@ void Application::initPubsub()
|
||||
|
||||
QString text =
|
||||
QString("%1 turned %2 %3 mode")
|
||||
.arg(action.source.name)
|
||||
.arg(action.source.login)
|
||||
.arg(action.state == ModeChangedAction::State::On ? "on"
|
||||
: "off")
|
||||
.arg(action.getModeName());
|
||||
|
||||
if (action.duration > 0)
|
||||
{
|
||||
text.append(" (" + QString::number(action.duration) +
|
||||
" seconds)");
|
||||
text += QString(" (%1 seconds)").arg(action.duration);
|
||||
}
|
||||
|
||||
auto msg = makeSystemMessage(text);
|
||||
@@ -254,16 +253,10 @@ void Application::initPubsub()
|
||||
|
||||
QString text;
|
||||
|
||||
if (action.modded)
|
||||
{
|
||||
text = QString("%1 modded %2")
|
||||
.arg(action.source.name, action.target.name);
|
||||
}
|
||||
else
|
||||
{
|
||||
text = QString("%1 unmodded %2")
|
||||
.arg(action.source.name, action.target.name);
|
||||
}
|
||||
text = QString("%1 %2 %3")
|
||||
.arg(action.source.login,
|
||||
(action.modded ? "modded" : "unmodded"),
|
||||
action.target.login);
|
||||
|
||||
auto msg = makeSystemMessage(text);
|
||||
postToThread([chan, msg] {
|
||||
|
||||
Reference in New Issue
Block a user