From 5bf1a5a7dda6e677894eaaf1100c540d5be1c26b Mon Sep 17 00:00:00 2001 From: nerix Date: Fri, 19 Jan 2024 13:11:25 +0100 Subject: [PATCH] fix: ignore channel name when copying message (#5106) Fixes #5101 --- CHANGELOG.md | 1 + src/messages/layouts/MessageLayoutContainer.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e8537e8f4a..edd7b9179be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,6 +68,7 @@ - Bugfix: Fixed a bug where buttons would remain in a hovered state after leaving them. (#5077) - Bugfix: Fixed popup windows not persisting between restarts. (#5081) - Bugfix: Fixed splits not retaining their focus after minimizing. (#5080) +- Bugfix: Fixed _Copy message_ copying the channel name in global search. (#5106) - Dev: Run miniaudio in a separate thread, and simplify it to not manage the device ourselves. There's a chance the simplification is a bad idea. (#4978) - Dev: Change clang-format from v14 to v16. (#4929) - Dev: Fixed UTF16 encoding of `modes` file for the installer. (#4791) diff --git a/src/messages/layouts/MessageLayoutContainer.cpp b/src/messages/layouts/MessageLayoutContainer.cpp index aa3135a00be..091d913be25 100644 --- a/src/messages/layouts/MessageLayoutContainer.cpp +++ b/src/messages/layouts/MessageLayoutContainer.cpp @@ -318,9 +318,12 @@ void MessageLayoutContainer::addSelectionText(QString &str, uint32_t from, if (copymode == CopyMode::OnlyTextAndEmotes) { - if (element->getCreator().getFlags().hasAny( - {MessageElementFlag::Timestamp, - MessageElementFlag::Username, MessageElementFlag::Badges})) + if (element->getCreator().getFlags().hasAny({ + MessageElementFlag::Timestamp, + MessageElementFlag::Username, + MessageElementFlag::Badges, + MessageElementFlag::ChannelName, + })) { continue; }