mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-04 19:03:42 +00:00
feat: disable reactions in channels and groups
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user