feat: /reply command now replies to the latest message of the user (#4919)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
iProdigy
2023-11-05 07:30:15 -08:00
committed by GitHub
parent 1d6c9ed279
commit 9dd83b040b
2 changed files with 4 additions and 7 deletions
@@ -1564,20 +1564,16 @@ void CommandController::initialize(Settings &, Paths &paths)
const auto &msg = *it;
if (msg->loginName.compare(username, Qt::CaseInsensitive) == 0)
{
std::shared_ptr<MessageThread> thread;
// found most recent message by user
if (msg->replyThread == nullptr)
{
thread = std::make_shared<MessageThread>(msg);
// prepare thread if one does not exist
auto thread = std::make_shared<MessageThread>(msg);
twitchChannel->addReplyThread(thread);
}
else
{
thread = msg->replyThread;
}
QString reply = words.mid(2).join(" ");
twitchChannel->sendReply(reply, thread->rootId());
twitchChannel->sendReply(reply, msg->id);
return "";
}
}