From 6f1bd0014cad37f2f0b43a9b83733d9f65a91406 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Tue, 13 Jun 2023 21:28:18 -0400 Subject: refactor, update user mention handling --- src/misc/chatutil.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/misc/chatutil.cpp') diff --git a/src/misc/chatutil.cpp b/src/misc/chatutil.cpp index a87df00..b5917ca 100644 --- a/src/misc/chatutil.cpp +++ b/src/misc/chatutil.cpp @@ -74,17 +74,17 @@ void HandleUserMentions(const Glib::RefPtr &buf, Snowflake chan if (channel->Type == ChannelType::DM || channel->Type == ChannelType::GROUP_DM || !channel->GuildID.has_value() || plain) { if (plain) { - replacement = "@" + user->Username + "#" + user->Discriminator; + replacement = "@" + user->GetUsername(); } else { - replacement = user->GetEscapedBoldString(); + replacement = user->GetUsernameEscapedBold(); } } else { const auto role_id = user->GetHoistedRole(*channel->GuildID, true); const auto role = discord.GetRole(role_id); if (!role.has_value()) - replacement = user->GetEscapedBoldString(); + replacement = user->GetUsernameEscapedBold(); else - replacement = "Color) + "\">" + user->GetEscapedBoldString() + ""; + replacement = "Color) + "\">" + user->GetUsernameEscapedBold() + ""; } // regex returns byte positions and theres no straightforward way in the c++ bindings to deal with that :( -- cgit v1.2.3