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:
@@ -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 "";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user