mirror of
https://github.com/uowuo/abaddon.git
synced 2024-11-10 06:00:10 +00:00
parent
5e244e5cb8
commit
893c9b5241
@ -1057,10 +1057,9 @@ void ChatMessageHeader::UpdateName() {
|
||||
const auto chan = discord.GetChannel(ChannelID);
|
||||
bool is_guild = chan.has_value() && chan->GuildID.has_value();
|
||||
if (is_guild) {
|
||||
const auto member = discord.GetMember(UserID, *chan->GuildID);
|
||||
const auto role_id = discord.GetMemberHoistedRole(*chan->GuildID, UserID, true);
|
||||
const auto role = discord.GetRole(role_id);
|
||||
const auto name = GetEscapedDisplayName(*user, member);
|
||||
const auto name = user->GetDisplayNameEscaped(*chan->GuildID);
|
||||
|
||||
std::string md;
|
||||
if (role.has_value())
|
||||
@ -1090,13 +1089,6 @@ void ChatMessageHeader::AttachUserMenuHandler(Gtk::Widget &widget) {
|
||||
});
|
||||
}
|
||||
|
||||
Glib::ustring ChatMessageHeader::GetEscapedDisplayName(const UserData &user, const std::optional<GuildMember> &member) {
|
||||
if (member.has_value() && !member->Nickname.empty())
|
||||
return Glib::Markup::escape_text(member->Nickname);
|
||||
else
|
||||
return Glib::Markup::escape_text(user.GetDisplayNameEscaped());
|
||||
}
|
||||
|
||||
bool ChatMessageHeader::on_author_button_press(GdkEventButton *ev) {
|
||||
if (ev->button == GDK_BUTTON_PRIMARY && (ev->state & GDK_SHIFT_MASK)) {
|
||||
m_signal_action_insert_mention.emit();
|
||||
|
@ -84,7 +84,6 @@ public:
|
||||
|
||||
protected:
|
||||
void AttachUserMenuHandler(Gtk::Widget &widget);
|
||||
static Glib::ustring GetEscapedDisplayName(const UserData &user, const std::optional<GuildMember> &member);
|
||||
|
||||
bool on_author_button_press(GdkEventButton *ev);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user