Improve reply popup after thread update (#4923)

Co-authored-by: nerix <nero.9@hotmail.de>
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
iProdigy
2023-11-05 08:25:26 -08:00
committed by GitHub
parent 9dd83b040b
commit 5209e47df1
12 changed files with 177 additions and 59 deletions
+8 -6
View File
@@ -2331,6 +2331,10 @@ void ChannelView::addMessageContextMenuItems(QMenu *menu,
if (messagePtr->replyThread != nullptr)
{
menu->addAction("Reply to &original thread", [this, &messagePtr] {
this->setInputReply(messagePtr->replyThread->root());
});
menu->addAction("View &thread", [this, &messagePtr] {
this->showReplyThreadPopup(messagePtr);
});
@@ -2871,19 +2875,17 @@ void ChannelView::setInputReply(const MessagePtr &message)
return;
}
auto thread = message->replyThread;
if (!thread)
if (!message->replyThread)
{
// Message did not already have a thread attached, try to find or create one
if (auto *tc =
dynamic_cast<TwitchChannel *>(this->underlyingChannel_.get()))
{
thread = tc->getOrCreateThread(message);
tc->getOrCreateThread(message);
}
else if (auto *tc = dynamic_cast<TwitchChannel *>(this->channel_.get()))
{
thread = tc->getOrCreateThread(message);
tc->getOrCreateThread(message);
}
else
{
@@ -2894,7 +2896,7 @@ void ChannelView::setInputReply(const MessagePtr &message)
}
}
this->split_->setInputReply(thread);
this->split_->setInputReply(message);
}
void ChannelView::showReplyThreadPopup(const MessagePtr &message)