summaryrefslogtreecommitdiff
path: root/src/misc/chatutil.cpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2023-06-13 21:28:18 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2023-06-13 21:28:18 -0400
commit6f1bd0014cad37f2f0b43a9b83733d9f65a91406 (patch)
tree94792781e7d6a18b7e528d8adfa5e1c7656c177f /src/misc/chatutil.cpp
parenta4a8293a0e9dc2e7023cc5f407eb78a505f22129 (diff)
downloadabaddon-portaudio-6f1bd0014cad37f2f0b43a9b83733d9f65a91406.tar.gz
abaddon-portaudio-6f1bd0014cad37f2f0b43a9b83733d9f65a91406.zip
refactor, update user mention handling
Diffstat (limited to 'src/misc/chatutil.cpp')
-rw-r--r--src/misc/chatutil.cpp8
1 files changed, 4 insertions, 4 deletions
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<Gtk::TextBuffer> &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<true>();
+ replacement = user->GetUsernameEscapedBold<true>();
}
} else {
const auto role_id = user->GetHoistedRole(*channel->GuildID, true);
const auto role = discord.GetRole(role_id);
if (!role.has_value())
- replacement = user->GetEscapedBoldString<true>();
+ replacement = user->GetUsernameEscapedBold<true>();
else
- replacement = "<span color=\"#" + IntToCSSColor(role->Color) + "\">" + user->GetEscapedBoldString<true>() + "</span>";
+ replacement = "<span color=\"#" + IntToCSSColor(role->Color) + "\">" + user->GetUsernameEscapedBold<true>() + "</span>";
}
// regex returns byte positions and theres no straightforward way in the c++ bindings to deal with that :(