From cd2923c52a4b9cddf2f259435a0f813c997fcbaf Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Sun, 29 Aug 2021 14:05:45 +0200 Subject: [PATCH] Fix missing information in locally-generated IRC messages (#3203) Co-authored-by: pajlada --- CHANGELOG.md | 1 + src/providers/irc/IrcChannel2.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64a81ee1d..1c5b2d992 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ - Bugfix: Moderation mode and active filters are now preserved when opening a split as a popup. (#3113, #3130) - Bugfix: Fixed a bug that caused all badge highlights to use the same color. (#3132, #3134) - Bugfix: Allow starting Streamlink from Chatterino when running as a Flatpak. (#3178) +- Bugfix: Fixed own IRC messages not having metadata and a link to a usercard. (#3203) - Dev: Renamed CMake's build option `USE_SYSTEM_QT5KEYCHAIN` to `USE_SYSTEM_QTKEYCHAIN`. (#3103) - Dev: Add benchmarks that can be compiled with the `BUILD_BENCHMARKS` CMake flag. Off by default. (#3038) diff --git a/src/providers/irc/IrcChannel2.cpp b/src/providers/irc/IrcChannel2.cpp index b7b17fc72..940a74410 100644 --- a/src/providers/irc/IrcChannel2.cpp +++ b/src/providers/irc/IrcChannel2.cpp @@ -1,6 +1,7 @@ #include "IrcChannel2.hpp" #include "debug/AssertInGuiThread.hpp" +#include "messages/Message.hpp" #include "messages/MessageBuilder.hpp" #include "providers/irc/IrcCommands.hpp" #include "providers/irc/IrcServer.hpp" @@ -33,9 +34,14 @@ void IrcChannel::sendMessage(const QString &message) MessageBuilder builder; builder.emplace(); - builder.emplace(this->server()->nick() + ":", - MessageElementFlag::Username); + const auto &nick = this->server()->nick(); + builder.emplace(nick + ":", MessageElementFlag::Username) + ->setLink({Link::UserInfo, nick}); builder.emplace(message, MessageElementFlag::Text); + builder.message().messageText = message; + builder.message().searchText = nick + ": " + message; + builder.message().loginName = nick; + builder.message().displayName = nick; this->addMessage(builder.release()); } }