fix: don't show reply button on inline whispers or announcements (#5863)

This commit is contained in:
Matthias Kronberg
2025-01-30 22:33:44 +01:00
committed by GitHub
parent f914e0406e
commit 22f5f4ea26
3 changed files with 20 additions and 29 deletions
+19 -16
View File
@@ -2258,23 +2258,26 @@ std::pair<MessagePtrMut, HighlightAlert> MessageBuilder::makeIrcMessage(
ColorProvider::instance().color(ColorType::Whisper);
}
if (thread)
if (!args.isReceivedWhisper && tags.value("msg-id") != "announcement")
{
auto &img = getResources().buttons.replyThreadDark;
builder
.emplace<CircularImageElement>(Image::fromResourcePixmap(img, 0.15),
2, Qt::gray,
MessageElementFlag::ReplyButton)
->setLink({Link::ViewThread, thread->rootId()});
}
else
{
auto &img = getResources().buttons.replyDark;
builder
.emplace<CircularImageElement>(Image::fromResourcePixmap(img, 0.15),
2, Qt::gray,
MessageElementFlag::ReplyButton)
->setLink({Link::ReplyToMessage, builder->id});
if (thread)
{
auto &img = getResources().buttons.replyThreadDark;
builder
.emplace<CircularImageElement>(
Image::fromResourcePixmap(img, 0.15), 2, Qt::gray,
MessageElementFlag::ReplyButton)
->setLink({Link::ViewThread, thread->rootId()});
}
else
{
auto &img = getResources().buttons.replyDark;
builder
.emplace<CircularImageElement>(
Image::fromResourcePixmap(img, 0.15), 2, Qt::gray,
MessageElementFlag::ReplyButton)
->setLink({Link::ReplyToMessage, builder->id});
}
}
return {builder.release(), highlight};