Add option to subscribe to and pin reply threads (#4680)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
nerix
2023-06-17 17:41:52 +02:00
committed by GitHub
parent 2d3d3ae46e
commit aff9342647
15 changed files with 194 additions and 69 deletions
+26 -17
View File
@@ -119,31 +119,40 @@ void updateReplyParticipatedStatus(const QVariantMap &tags,
{
const auto &currentLogin =
getApp()->accounts->twitch.getCurrent()->getUserName();
if (thread->participated())
if (thread->subscribed())
{
builder.message().flags.set(MessageFlag::ParticipatedThread);
builder.message().flags.set(MessageFlag::SubscribedThread);
return;
}
if (isNew)
if (thread->unsubscribed())
{
if (const auto it = tags.find("reply-parent-user-login");
it != tags.end())
{
auto name = it.value().toString();
if (name == currentLogin)
{
thread->markParticipated();
builder.message().flags.set(MessageFlag::ParticipatedThread);
return; // already marked as participated
}
}
return;
}
if (senderLogin == currentLogin)
if (getSettings()->autoSubToParticipatedThreads)
{
thread->markParticipated();
// don't set the highlight here
if (isNew)
{
if (const auto it = tags.find("reply-parent-user-login");
it != tags.end())
{
auto name = it.value().toString();
if (name == currentLogin)
{
thread->markSubscribed();
builder.message().flags.set(MessageFlag::SubscribedThread);
return; // already marked as participated
}
}
}
if (senderLogin == currentLogin)
{
thread->markSubscribed();
// don't set the highlight here
}
}
}