From 45e4fc04efd2278231f687a4786ba77d707f59cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82?= Date: Sat, 25 Dec 2021 15:04:35 +0100 Subject: [PATCH] Sorted usernames in "Users joined/parted:" messages (#3421) --- CHANGELOG.md | 1 + src/common/ChannelChatters.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eee2332f2..cab043d73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ - Minor: Show picked outcome in prediction badges. (#3357) - Minor: Add support for Emoji in IRC (#3354) - Minor: Moved `/live` logs to its own subdirectory. (Logs from before this change will still be available in `Channels -> live`). (#3393) +- Minor: Sorted usernames in `Users joined/parted` messages alphabetically. (#3421) - Bugfix: Fix Split Input hotkeys not being available when input is hidden (#3362) - Bugfix: Fixed colored usernames sometimes not working. (#3170) - Bugfix: Restored ability to send duplicate `/me` messages. (#3166) diff --git a/src/common/ChannelChatters.cpp b/src/common/ChannelChatters.cpp index 59e843d1b..3f4f10420 100644 --- a/src/common/ChannelChatters.cpp +++ b/src/common/ChannelChatters.cpp @@ -34,13 +34,15 @@ void ChannelChatters::addJoinedUser(const QString &user) QTimer::singleShot(500, &this->lifetimeGuard_, [this] { auto joinedUsers = this->joinedUsers_.access(); + joinedUsers->sort(); MessageBuilder builder; TwitchMessageBuilder::listOfUsersSystemMessage( "Users joined:", *joinedUsers, &this->channel_, &builder); builder->flags.set(MessageFlag::Collapsed); - joinedUsers->clear(); this->channel_.addMessage(builder.release()); + + joinedUsers->clear(); this->joinedUsersMergeQueued_ = false; }); } @@ -57,14 +59,15 @@ void ChannelChatters::addPartedUser(const QString &user) QTimer::singleShot(500, &this->lifetimeGuard_, [this] { auto partedUsers = this->partedUsers_.access(); + partedUsers->sort(); MessageBuilder builder; TwitchMessageBuilder::listOfUsersSystemMessage( "Users parted:", *partedUsers, &this->channel_, &builder); builder->flags.set(MessageFlag::Collapsed); this->channel_.addMessage(builder.release()); - partedUsers->clear(); + partedUsers->clear(); this->partedUsersMergeQueued_ = false; }); }