mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-07-21 13:12:50 +02:00
fix: rename hide reactions
The logic is inverted everywhere, e.g. when `hideGroupReactions` is true, it's actually meant to show, not hide
This commit is contained in:
parent
aeb610ff70
commit
8aa6c4582c
9 changed files with 26 additions and 26 deletions
|
@ -47,10 +47,10 @@ bool UnreadThings::trackReactions(Data::Thread *thread) const {
|
|||
return false;
|
||||
}
|
||||
const auto &settings = AyuSettings::getInstance();
|
||||
if (peer->isChannel() && !peer->isMegagroup() && !settings.hideChannelReactions) {
|
||||
if (peer->isChannel() && !peer->isMegagroup() && !settings.showChannelReactions) {
|
||||
return false;
|
||||
}
|
||||
if (peer->isMegagroup() && !settings.hideGroupReactions) {
|
||||
if (peer->isMegagroup() && !settings.showGroupReactions) {
|
||||
return false;
|
||||
}
|
||||
return peer->isUser() || peer->isChat() || peer->isMegagroup();
|
||||
|
|
|
@ -231,8 +231,8 @@ AyuGramSettings::AyuGramSettings() {
|
|||
|
||||
disableNotificationsDelay = false;
|
||||
localPremium = false;
|
||||
hideChannelReactions = true;
|
||||
hideGroupReactions = true;
|
||||
showChannelReactions = true;
|
||||
showGroupReactions = true;
|
||||
|
||||
// ~ Customization
|
||||
appIcon =
|
||||
|
@ -420,11 +420,11 @@ void set_localPremium(bool val) {
|
|||
}
|
||||
|
||||
void set_hideChannelReactions(bool val) {
|
||||
settings->hideChannelReactions = val;
|
||||
settings->showChannelReactions = val;
|
||||
}
|
||||
|
||||
void set_hideGroupReactions(bool val) {
|
||||
settings->hideGroupReactions = val;
|
||||
settings->showGroupReactions = val;
|
||||
}
|
||||
|
||||
void set_appIcon(const QString &val) {
|
||||
|
|
|
@ -76,8 +76,8 @@ public:
|
|||
|
||||
bool disableNotificationsDelay;
|
||||
bool localPremium;
|
||||
bool hideChannelReactions;
|
||||
bool hideGroupReactions;
|
||||
bool showChannelReactions;
|
||||
bool showGroupReactions;
|
||||
|
||||
QString appIcon;
|
||||
bool simpleQuotesAndReplies;
|
||||
|
@ -259,8 +259,8 @@ inline void to_json(nlohmann::json &nlohmann_json_j, const AyuGramSettings &nloh
|
|||
NLOHMANN_JSON_TO(showGhostToggleInTray)
|
||||
NLOHMANN_JSON_TO(showStreamerToggleInTray)
|
||||
NLOHMANN_JSON_TO(monoFont)
|
||||
NLOHMANN_JSON_TO(hideChannelReactions)
|
||||
NLOHMANN_JSON_TO(hideGroupReactions)
|
||||
NLOHMANN_JSON_TO(showChannelReactions)
|
||||
NLOHMANN_JSON_TO(showGroupReactions)
|
||||
NLOHMANN_JSON_TO(hideNotificationCounters)
|
||||
NLOHMANN_JSON_TO(hideNotificationBadge)
|
||||
NLOHMANN_JSON_TO(hideAllChatsFolder)
|
||||
|
@ -324,8 +324,8 @@ inline void from_json(const nlohmann::json &nlohmann_json_j, AyuGramSettings &nl
|
|||
NLOHMANN_JSON_FROM_WITH_DEFAULT(showGhostToggleInTray)
|
||||
NLOHMANN_JSON_FROM_WITH_DEFAULT(showStreamerToggleInTray)
|
||||
NLOHMANN_JSON_FROM_WITH_DEFAULT(monoFont)
|
||||
NLOHMANN_JSON_FROM_WITH_DEFAULT(hideChannelReactions)
|
||||
NLOHMANN_JSON_FROM_WITH_DEFAULT(hideGroupReactions)
|
||||
NLOHMANN_JSON_FROM_WITH_DEFAULT(showChannelReactions)
|
||||
NLOHMANN_JSON_FROM_WITH_DEFAULT(showGroupReactions)
|
||||
NLOHMANN_JSON_FROM_WITH_DEFAULT(hideNotificationCounters)
|
||||
NLOHMANN_JSON_FROM_WITH_DEFAULT(hideNotificationBadge)
|
||||
NLOHMANN_JSON_FROM_WITH_DEFAULT(hideAllChatsFolder)
|
||||
|
|
|
@ -855,12 +855,12 @@ void SetupQoLToggles(not_null<Ui::VerticalLayout*> container) {
|
|||
tr::ayu_HideChannelReactions(),
|
||||
st::settingsButtonNoIcon
|
||||
)->toggleOn(
|
||||
rpl::single(!settings->hideChannelReactions)
|
||||
rpl::single(!settings->showChannelReactions)
|
||||
)->toggledValue(
|
||||
) | rpl::filter(
|
||||
[=](bool enabled)
|
||||
{
|
||||
return (!enabled != settings->hideChannelReactions);
|
||||
return (!enabled != settings->showChannelReactions);
|
||||
}) | start_with_next(
|
||||
[=](bool enabled)
|
||||
{
|
||||
|
@ -874,12 +874,12 @@ void SetupQoLToggles(not_null<Ui::VerticalLayout*> container) {
|
|||
tr::ayu_HideGroupReactions(),
|
||||
st::settingsButtonNoIcon
|
||||
)->toggleOn(
|
||||
rpl::single(!settings->hideGroupReactions)
|
||||
rpl::single(!settings->showGroupReactions)
|
||||
)->toggledValue(
|
||||
) | rpl::filter(
|
||||
[=](bool enabled)
|
||||
{
|
||||
return (!enabled != settings->hideGroupReactions);
|
||||
return (!enabled != settings->showGroupReactions);
|
||||
}) | start_with_next(
|
||||
[=](bool enabled)
|
||||
{
|
||||
|
|
|
@ -2429,8 +2429,8 @@ Dialogs::UnreadState History::computeUnreadState() const {
|
|||
result.mentions = unreadMentions().has() ? 1 : 0;
|
||||
const auto peer = this->peer.get();
|
||||
const auto &settings = AyuSettings::getInstance();
|
||||
const auto hideReactions = (peer->isChannel() && !peer->isMegagroup() && !settings.hideChannelReactions)
|
||||
|| (peer->isMegagroup() && !settings.hideGroupReactions);
|
||||
const auto hideReactions = (peer->isChannel() && !peer->isMegagroup() && !settings.showChannelReactions)
|
||||
|| (peer->isMegagroup() && !settings.showGroupReactions);
|
||||
result.reactions = hideReactions ? 0 : (unreadReactions().has() ? 1 : 0);
|
||||
result.messagesMuted = muted ? result.messages : 0;
|
||||
result.chatsMuted = muted ? result.chats : 0;
|
||||
|
|
|
@ -1221,8 +1221,8 @@ void HistoryInner::paintEvent(QPaintEvent *e) {
|
|||
if (markingAsViewed && item->hasUnwatchedEffect()) {
|
||||
const auto peer = item->history()->peer;
|
||||
const auto &settings = AyuSettings::getInstance();
|
||||
const auto hide = (!settings.hideChannelReactions && peer->isChannel() && !peer->isMegagroup()) ||
|
||||
(!settings.hideGroupReactions && peer->isMegagroup());
|
||||
const auto hide = (!settings.showChannelReactions && peer->isChannel() && !peer->isMegagroup()) ||
|
||||
(!settings.showGroupReactions && peer->isMegagroup());
|
||||
if (!hide) {
|
||||
startEffects.emplace(view);
|
||||
} else {
|
||||
|
|
|
@ -1171,8 +1171,8 @@ void CheckReactionNotificationSchedule(
|
|||
}
|
||||
const auto peer = item->history()->peer;
|
||||
const auto &settings = AyuSettings::getInstance();
|
||||
if ((peer->isChannel() && !peer->isMegagroup() && !settings.hideChannelReactions)
|
||||
|| (peer->isMegagroup() && !settings.hideGroupReactions)) {
|
||||
if ((peer->isChannel() && !peer->isMegagroup() && !settings.showChannelReactions)
|
||||
|| (peer->isMegagroup() && !settings.showGroupReactions)) {
|
||||
item->markEffectWatched();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -835,12 +835,12 @@ InlineListData InlineListDataFromMessage(not_null<Element*> view) {
|
|||
using Flag = InlineListData::Flag;
|
||||
const auto item = view->data();
|
||||
const auto &settings = AyuSettings::getInstance();
|
||||
if (!settings.hideChannelReactions
|
||||
if (!settings.showChannelReactions
|
||||
&& item->history()->peer->isChannel()
|
||||
&& !item->history()->peer->isMegagroup()) {
|
||||
return InlineListData();
|
||||
}
|
||||
if (!settings.hideGroupReactions
|
||||
if (!settings.showGroupReactions
|
||||
&& item->history()->peer->isMegagroup()) {
|
||||
return InlineListData();
|
||||
}
|
||||
|
|
|
@ -1358,8 +1358,8 @@ AttachSelectorResult AttachSelectorToMenu(
|
|||
}
|
||||
|
||||
const auto peer = item->history()->peer;
|
||||
if ((peer->isChannel() && !peer->isMegagroup() && !settings.hideChannelReactions)
|
||||
|| (peer->isMegagroup() && !settings.hideGroupReactions)) {
|
||||
if ((peer->isChannel() && !peer->isMegagroup() && !settings.showChannelReactions)
|
||||
|| (peer->isMegagroup() && !settings.showGroupReactions)) {
|
||||
return AttachSelectorResult::Skipped;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue