From 4a0ef08a00bcc08fbf0e2803083db6355b5fc8d9 Mon Sep 17 00:00:00 2001 From: fraxx <101990229+fraxxio@users.noreply.github.com> Date: Wed, 3 Jan 2024 13:24:23 +0200 Subject: [PATCH] Added missing periods at mod-related messages and some system messages (#5061) Co-authored-by: Rasmus Karlsson --- CHANGELOG.md | 1 + src/Application.cpp | 6 +++--- src/controllers/commands/builtin/Misc.cpp | 10 +++++----- .../commands/builtin/twitch/AddModerator.cpp | 2 +- .../commands/builtin/twitch/AddVIP.cpp | 2 +- .../commands/builtin/twitch/Announce.cpp | 2 +- .../commands/builtin/twitch/Ban.cpp | 6 +++--- .../commands/builtin/twitch/Block.cpp | 4 ++-- .../commands/builtin/twitch/ChatSettings.cpp | 20 +++++++++---------- .../commands/builtin/twitch/Chatters.cpp | 6 +++--- .../builtin/twitch/DeleteMessages.cpp | 4 ++-- .../commands/builtin/twitch/GetModerators.cpp | 2 +- .../commands/builtin/twitch/GetVIPs.cpp | 2 +- .../commands/builtin/twitch/Raid.cpp | 4 ++-- .../builtin/twitch/RemoveModerator.cpp | 2 +- .../commands/builtin/twitch/RemoveVIP.cpp | 2 +- .../commands/builtin/twitch/SendReply.cpp | 4 ++-- .../commands/builtin/twitch/ShieldMode.cpp | 4 ++-- .../commands/builtin/twitch/Shoutout.cpp | 4 ++-- .../builtin/twitch/StartCommercial.cpp | 4 ++-- .../commands/builtin/twitch/Unban.cpp | 2 +- .../commands/builtin/twitch/UpdateColor.cpp | 4 ++-- src/messages/MessageBuilder.cpp | 5 +++-- 23 files changed, 52 insertions(+), 50 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 717cc71f..0ee79f73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ - Minor: Add a new completion API for experimental plugins feature. (#5000, #5047) - Minor: Re-enabled _Restart on crash_ option on Windows. (#5012) - Minor: The whisper highlight color can now be configured through the settings. (#5053) +- Minor: Added missing periods at various moderator messages and commands. (#5061) - Bugfix: Fixed an issue where certain emojis did not send to Twitch chat correctly. (#4840) - Bugfix: Fixed capitalized channel names in log inclusion list not being logged. (#4848) - Bugfix: Trimmed custom streamlink paths on all platforms making sure you don't accidentally add spaces at the beginning or end of its path. (#4834) diff --git a/src/Application.cpp b/src/Application.cpp index 37ba100c..689a2e4f 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -352,7 +352,7 @@ void Application::initPubSub() } QString text = - QString("%1 cleared the chat").arg(action.source.login); + QString("%1 cleared the chat.").arg(action.source.login); auto msg = makeSystemMessage(text); postToThread([chan, msg] { @@ -369,7 +369,7 @@ void Application::initPubSub() } QString text = - QString("%1 turned %2 %3 mode") + QString("%1 turned %2 %3 mode.") .arg(action.source.login) .arg(action.state == ModeChangedAction::State::On ? "on" : "off") @@ -397,7 +397,7 @@ void Application::initPubSub() QString text; - text = QString("%1 %2 %3") + text = QString("%1 %2 %3.") .arg(action.source.login, (action.modded ? "modded" : "unmodded"), action.target.login); diff --git a/src/controllers/commands/builtin/Misc.cpp b/src/controllers/commands/builtin/Misc.cpp index 870e5b34..16160f6b 100644 --- a/src/controllers/commands/builtin/Misc.cpp +++ b/src/controllers/commands/builtin/Misc.cpp @@ -66,7 +66,7 @@ QString uptime(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /uptime command only works in Twitch Channels")); + "The /uptime command only works in Twitch Channels.")); return ""; } @@ -188,14 +188,14 @@ QString clip(const CommandContext &ctx) type != Channel::Type::Twitch && type != Channel::Type::TwitchWatching) { ctx.channel->addMessage(makeSystemMessage( - "The /clip command only works in Twitch Channels")); + "The /clip command only works in Twitch Channels.")); return ""; } if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /clip command only works in Twitch Channels")); + "The /clip command only works in Twitch Channels.")); return ""; } @@ -214,7 +214,7 @@ QString marker(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /marker command only works in Twitch channels")); + "The /marker command only works in Twitch channels.")); return ""; } @@ -520,7 +520,7 @@ QString unstableSetUserClientSideColor(const CommandContext &ctx) { ctx.channel->addMessage( makeSystemMessage("The /unstable-set-user-color command only " - "works in Twitch channels")); + "works in Twitch channels.")); return ""; } if (ctx.words.size() < 2) diff --git a/src/controllers/commands/builtin/twitch/AddModerator.cpp b/src/controllers/commands/builtin/twitch/AddModerator.cpp index 5f244c0a..19950830 100644 --- a/src/controllers/commands/builtin/twitch/AddModerator.cpp +++ b/src/controllers/commands/builtin/twitch/AddModerator.cpp @@ -23,7 +23,7 @@ QString addModerator(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /mod command only works in Twitch channels")); + "The /mod command only works in Twitch channels.")); return ""; } if (ctx.words.size() < 2) diff --git a/src/controllers/commands/builtin/twitch/AddVIP.cpp b/src/controllers/commands/builtin/twitch/AddVIP.cpp index 11ecaed4..e7905cf8 100644 --- a/src/controllers/commands/builtin/twitch/AddVIP.cpp +++ b/src/controllers/commands/builtin/twitch/AddVIP.cpp @@ -23,7 +23,7 @@ QString addVIP(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /vip command only works in Twitch channels")); + "The /vip command only works in Twitch channels.")); return ""; } if (ctx.words.size() < 2) diff --git a/src/controllers/commands/builtin/twitch/Announce.cpp b/src/controllers/commands/builtin/twitch/Announce.cpp index 869f25ad..2f8b5ec1 100644 --- a/src/controllers/commands/builtin/twitch/Announce.cpp +++ b/src/controllers/commands/builtin/twitch/Announce.cpp @@ -37,7 +37,7 @@ QString sendAnnouncement(const CommandContext &ctx) if (user->isAnon()) { ctx.channel->addMessage(makeSystemMessage( - "You must be logged in to use the /announce command")); + "You must be logged in to use the /announce command.")); return ""; } diff --git a/src/controllers/commands/builtin/twitch/Ban.cpp b/src/controllers/commands/builtin/twitch/Ban.cpp index b2589d79..2f9cef46 100644 --- a/src/controllers/commands/builtin/twitch/Ban.cpp +++ b/src/controllers/commands/builtin/twitch/Ban.cpp @@ -133,7 +133,7 @@ QString sendBan(const CommandContext &ctx) if (twitchChannel == nullptr) { channel->addMessage(makeSystemMessage( - QString("The /ban command only works in Twitch channels"))); + QString("The /ban command only works in Twitch channels."))); return ""; } @@ -196,7 +196,7 @@ QString sendBanById(const CommandContext &ctx) if (twitchChannel == nullptr) { channel->addMessage(makeSystemMessage( - QString("The /banid command only works in Twitch channels"))); + QString("The /banid command only works in Twitch channels."))); return ""; } @@ -241,7 +241,7 @@ QString sendTimeout(const CommandContext &ctx) if (twitchChannel == nullptr) { channel->addMessage(makeSystemMessage( - QString("The /timeout command only works in Twitch channels"))); + QString("The /timeout command only works in Twitch channels."))); return ""; } const auto *usageStr = diff --git a/src/controllers/commands/builtin/twitch/Block.cpp b/src/controllers/commands/builtin/twitch/Block.cpp index cb35c23b..1e2f3cc7 100644 --- a/src/controllers/commands/builtin/twitch/Block.cpp +++ b/src/controllers/commands/builtin/twitch/Block.cpp @@ -27,7 +27,7 @@ QString blockUser(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /block command only works in Twitch channels")); + "The /block command only works in Twitch channels.")); return ""; } @@ -101,7 +101,7 @@ QString unblockUser(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /unblock command only works in Twitch channels")); + "The /unblock command only works in Twitch channels.")); return ""; } diff --git a/src/controllers/commands/builtin/twitch/ChatSettings.cpp b/src/controllers/commands/builtin/twitch/ChatSettings.cpp index 09fd23db..fbe55474 100644 --- a/src/controllers/commands/builtin/twitch/ChatSettings.cpp +++ b/src/controllers/commands/builtin/twitch/ChatSettings.cpp @@ -111,7 +111,7 @@ QString emoteOnly(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /emoteonly command only works in Twitch channels")); + "The /emoteonly command only works in Twitch channels.")); return ""; } @@ -140,7 +140,7 @@ QString emoteOnlyOff(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /emoteonlyoff command only works in Twitch channels")); + "The /emoteonlyoff command only works in Twitch channels.")); return ""; } @@ -170,7 +170,7 @@ QString subscribers(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /subscribers command only works in Twitch channels")); + "The /subscribers command only works in Twitch channels.")); return ""; } @@ -200,7 +200,7 @@ QString subscribersOff(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /subscribersoff command only works in Twitch channels")); + "The /subscribersoff command only works in Twitch channels.")); return ""; } @@ -230,7 +230,7 @@ QString slow(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /slow command only works in Twitch channels")); + "The /slow command only works in Twitch channels.")); return ""; } @@ -277,7 +277,7 @@ QString slowOff(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /slowoff command only works in Twitch channels")); + "The /slowoff command only works in Twitch channels.")); return ""; } @@ -307,7 +307,7 @@ QString followers(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /followers command only works in Twitch channels")); + "The /followers command only works in Twitch channels.")); return ""; } @@ -355,7 +355,7 @@ QString followersOff(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /followersoff command only works in Twitch channels")); + "The /followersoff command only works in Twitch channels.")); return ""; } @@ -385,7 +385,7 @@ QString uniqueChat(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /uniquechat command only works in Twitch channels")); + "The /uniquechat command only works in Twitch channels.")); return ""; } @@ -415,7 +415,7 @@ QString uniqueChatOff(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /uniquechatoff command only works in Twitch channels")); + "The /uniquechatoff command only works in Twitch channels.")); return ""; } diff --git a/src/controllers/commands/builtin/twitch/Chatters.cpp b/src/controllers/commands/builtin/twitch/Chatters.cpp index 23ee43fd..f8781721 100644 --- a/src/controllers/commands/builtin/twitch/Chatters.cpp +++ b/src/controllers/commands/builtin/twitch/Chatters.cpp @@ -70,7 +70,7 @@ QString chatters(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /chatters command only works in Twitch Channels")); + "The /chatters command only works in Twitch Channels.")); return ""; } @@ -80,7 +80,7 @@ QString chatters(const CommandContext &ctx) getApp()->accounts->twitch.getCurrent()->getUserId(), 1, [channel{ctx.channel}](auto result) { channel->addMessage( - makeSystemMessage(QString("Chatter count: %1") + makeSystemMessage(QString("Chatter count: %1.") .arg(localizeNumbers(result.total)))); }, [channel{ctx.channel}](auto error, auto message) { @@ -101,7 +101,7 @@ QString testChatters(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /test-chatters command only works in Twitch Channels")); + "The /test-chatters command only works in Twitch Channels.")); return ""; } diff --git a/src/controllers/commands/builtin/twitch/DeleteMessages.cpp b/src/controllers/commands/builtin/twitch/DeleteMessages.cpp index 917a4373..bc6d8d27 100644 --- a/src/controllers/commands/builtin/twitch/DeleteMessages.cpp +++ b/src/controllers/commands/builtin/twitch/DeleteMessages.cpp @@ -102,7 +102,7 @@ QString deleteAllMessages(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /clear command only works in Twitch channels")); + "The /clear command only works in Twitch channels.")); return ""; } @@ -121,7 +121,7 @@ QString deleteOneMessage(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /delete command only works in Twitch channels")); + "The /delete command only works in Twitch channels.")); return ""; } diff --git a/src/controllers/commands/builtin/twitch/GetModerators.cpp b/src/controllers/commands/builtin/twitch/GetModerators.cpp index cc3a97ee..6f1908f0 100644 --- a/src/controllers/commands/builtin/twitch/GetModerators.cpp +++ b/src/controllers/commands/builtin/twitch/GetModerators.cpp @@ -61,7 +61,7 @@ QString getModerators(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /mods command only works in Twitch Channels")); + "The /mods command only works in Twitch Channels.")); return ""; } diff --git a/src/controllers/commands/builtin/twitch/GetVIPs.cpp b/src/controllers/commands/builtin/twitch/GetVIPs.cpp index 74a59a35..a03d8ccf 100644 --- a/src/controllers/commands/builtin/twitch/GetVIPs.cpp +++ b/src/controllers/commands/builtin/twitch/GetVIPs.cpp @@ -78,7 +78,7 @@ QString getVIPs(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /vips command only works in Twitch channels")); + "The /vips command only works in Twitch channels.")); return ""; } diff --git a/src/controllers/commands/builtin/twitch/Raid.cpp b/src/controllers/commands/builtin/twitch/Raid.cpp index b1cf0301..1df574f6 100644 --- a/src/controllers/commands/builtin/twitch/Raid.cpp +++ b/src/controllers/commands/builtin/twitch/Raid.cpp @@ -125,7 +125,7 @@ QString startRaid(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /raid command only works in Twitch channels")); + "The /raid command only works in Twitch channels.")); return ""; } @@ -183,7 +183,7 @@ QString cancelRaid(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /unraid command only works in Twitch channels")); + "The /unraid command only works in Twitch channels.")); return ""; } diff --git a/src/controllers/commands/builtin/twitch/RemoveModerator.cpp b/src/controllers/commands/builtin/twitch/RemoveModerator.cpp index c4ed6236..4bdedbf5 100644 --- a/src/controllers/commands/builtin/twitch/RemoveModerator.cpp +++ b/src/controllers/commands/builtin/twitch/RemoveModerator.cpp @@ -23,7 +23,7 @@ QString removeModerator(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /unmod command only works in Twitch channels")); + "The /unmod command only works in Twitch channels.")); return ""; } if (ctx.words.size() < 2) diff --git a/src/controllers/commands/builtin/twitch/RemoveVIP.cpp b/src/controllers/commands/builtin/twitch/RemoveVIP.cpp index 6922175a..620d5c1a 100644 --- a/src/controllers/commands/builtin/twitch/RemoveVIP.cpp +++ b/src/controllers/commands/builtin/twitch/RemoveVIP.cpp @@ -23,7 +23,7 @@ QString removeVIP(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /unvip command only works in Twitch channels")); + "The /unvip command only works in Twitch channels.")); return ""; } if (ctx.words.size() < 2) diff --git a/src/controllers/commands/builtin/twitch/SendReply.cpp b/src/controllers/commands/builtin/twitch/SendReply.cpp index a88fb0b5..381c66b3 100644 --- a/src/controllers/commands/builtin/twitch/SendReply.cpp +++ b/src/controllers/commands/builtin/twitch/SendReply.cpp @@ -20,7 +20,7 @@ QString sendReply(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /reply command only works in Twitch channels")); + "The /reply command only works in Twitch channels.")); return ""; } @@ -55,7 +55,7 @@ QString sendReply(const CommandContext &ctx) } ctx.channel->addMessage( - makeSystemMessage("A message from that user wasn't found")); + makeSystemMessage("A message from that user wasn't found.")); return ""; } diff --git a/src/controllers/commands/builtin/twitch/ShieldMode.cpp b/src/controllers/commands/builtin/twitch/ShieldMode.cpp index 2e9b7ca4..f3b48a36 100644 --- a/src/controllers/commands/builtin/twitch/ShieldMode.cpp +++ b/src/controllers/commands/builtin/twitch/ShieldMode.cpp @@ -18,7 +18,7 @@ QString toggleShieldMode(const CommandContext &ctx, bool isActivating) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - QStringLiteral("The %1 command only works in Twitch channels") + QStringLiteral("The %1 command only works in Twitch channels.") .arg(command))); return {}; } @@ -29,7 +29,7 @@ QString toggleShieldMode(const CommandContext &ctx, bool isActivating) if (user->isAnon()) { ctx.channel->addMessage(makeSystemMessage( - QStringLiteral("You must be logged in to use the %1 command") + QStringLiteral("You must be logged in to use the %1 command.") .arg(command))); return {}; } diff --git a/src/controllers/commands/builtin/twitch/Shoutout.cpp b/src/controllers/commands/builtin/twitch/Shoutout.cpp index af012cd3..d24b6778 100644 --- a/src/controllers/commands/builtin/twitch/Shoutout.cpp +++ b/src/controllers/commands/builtin/twitch/Shoutout.cpp @@ -20,7 +20,7 @@ QString sendShoutout(const CommandContext &ctx) if (twitchChannel == nullptr) { channel->addMessage(makeSystemMessage( - "The /shoutout command only works in Twitch channels")); + "The /shoutout command only works in Twitch channels.")); return ""; } @@ -28,7 +28,7 @@ QString sendShoutout(const CommandContext &ctx) if (currentUser->isAnon()) { channel->addMessage( - makeSystemMessage("You must be logged in to send shoutout")); + makeSystemMessage("You must be logged in to send shoutout.")); return ""; } diff --git a/src/controllers/commands/builtin/twitch/StartCommercial.cpp b/src/controllers/commands/builtin/twitch/StartCommercial.cpp index 545099a7..864c6af5 100644 --- a/src/controllers/commands/builtin/twitch/StartCommercial.cpp +++ b/src/controllers/commands/builtin/twitch/StartCommercial.cpp @@ -84,7 +84,7 @@ QString startCommercial(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - "The /commercial command only works in Twitch channels")); + "The /commercial command only works in Twitch channels.")); return ""; } @@ -106,7 +106,7 @@ QString startCommercial(const CommandContext &ctx) if (user->isAnon()) { ctx.channel->addMessage(makeSystemMessage( - "You must be logged in to use the /commercial command")); + "You must be logged in to use the /commercial command.")); return ""; } diff --git a/src/controllers/commands/builtin/twitch/Unban.cpp b/src/controllers/commands/builtin/twitch/Unban.cpp index b43ad550..3fa1748e 100644 --- a/src/controllers/commands/builtin/twitch/Unban.cpp +++ b/src/controllers/commands/builtin/twitch/Unban.cpp @@ -94,7 +94,7 @@ QString unbanUser(const CommandContext &ctx) if (ctx.twitchChannel == nullptr) { ctx.channel->addMessage(makeSystemMessage( - QString("The %1 command only works in Twitch channels") + QString("The %1 command only works in Twitch channels.") .arg(commandName))); return ""; } diff --git a/src/controllers/commands/builtin/twitch/UpdateColor.cpp b/src/controllers/commands/builtin/twitch/UpdateColor.cpp index 8057daee..497bd965 100644 --- a/src/controllers/commands/builtin/twitch/UpdateColor.cpp +++ b/src/controllers/commands/builtin/twitch/UpdateColor.cpp @@ -22,7 +22,7 @@ QString updateUserColor(const CommandContext &ctx) if (!ctx.channel->isTwitchChannel()) { ctx.channel->addMessage(makeSystemMessage( - "The /color command only works in Twitch channels")); + "The /color command only works in Twitch channels.")); return ""; } auto user = getApp()->accounts->twitch.getCurrent(); @@ -31,7 +31,7 @@ QString updateUserColor(const CommandContext &ctx) if (user->isAnon()) { ctx.channel->addMessage(makeSystemMessage( - "You must be logged in to use the /color command")); + "You must be logged in to use the /color command.")); return ""; } diff --git a/src/messages/MessageBuilder.cpp b/src/messages/MessageBuilder.cpp index d5ba0ff7..b13312c6 100644 --- a/src/messages/MessageBuilder.cpp +++ b/src/messages/MessageBuilder.cpp @@ -255,7 +255,8 @@ MessageBuilder::MessageBuilder(const BanAction &action, uint32_t count) this->emplaceSystemTextAndUpdate("banned", text); if (action.reason.isEmpty()) { - this->emplaceSystemTextAndUpdate(action.target.login, text) + this->emplaceSystemTextAndUpdate(action.target.login + ".", + text) ->setLink({Link::UserInfo, action.target.login}); } else @@ -315,7 +316,7 @@ MessageBuilder::MessageBuilder(const UnbanAction &action) ->setLink({Link::UserInfo, action.source.login}); this->emplaceSystemTextAndUpdate( action.wasBan() ? "unbanned" : "untimedout", text); - this->emplaceSystemTextAndUpdate(action.target.login, text) + this->emplaceSystemTextAndUpdate(action.target.login + ".", text) ->setLink({Link::UserInfo, action.target.login}); this->message().messageText = text;