feat: disable reactions in channels and groups

This commit is contained in:
Neurotoxin001
2025-07-06 17:22:26 +03:00
committed by GitHub
parent 3f5f17705d
commit 3bbb9daa34
10 changed files with 129 additions and 16 deletions
+15 -1
View File
@@ -17,6 +17,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "history/history_unread_things.h"
#include "apiwrap.h"
// AyuGram includes
#include "ayu/ayu_settings.h"
namespace Api {
namespace {
@@ -36,7 +40,17 @@ bool UnreadThings::trackMentions(Data::Thread *thread) const {
bool UnreadThings::trackReactions(Data::Thread *thread) const {
const auto peer = thread ? thread->peer().get() : nullptr;
return peer && (peer->isUser() || peer->isChat() || peer->isMegagroup());
if (!peer) {
return false;
}
const auto &settings = AyuSettings::getInstance();
if (peer->isChannel() && !peer->isMegagroup() && !settings.hideChannelReactions) {
return false;
}
if (peer->isMegagroup() && !settings.hideGroupReactions) {
return false;
}
return peer->isUser() || peer->isChat() || peer->isMegagroup();
}
void UnreadThings::preloadEnough(Data::Thread *thread) {