mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-09-07 04:24:09 +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;
|
return false;
|
||||||
}
|
}
|
||||||
const auto &settings = AyuSettings::getInstance();
|
const auto &settings = AyuSettings::getInstance();
|
||||||
if (peer->isChannel() && !peer->isMegagroup() && !settings.hideChannelReactions) {
|
if (peer->isChannel() && !peer->isMegagroup() && !settings.showChannelReactions) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (peer->isMegagroup() && !settings.hideGroupReactions) {
|
if (peer->isMegagroup() && !settings.showGroupReactions) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return peer->isUser() || peer->isChat() || peer->isMegagroup();
|
return peer->isUser() || peer->isChat() || peer->isMegagroup();
|
||||||
|
|
|
@ -231,8 +231,8 @@ AyuGramSettings::AyuGramSettings() {
|
||||||
|
|
||||||
disableNotificationsDelay = false;
|
disableNotificationsDelay = false;
|
||||||
localPremium = false;
|
localPremium = false;
|
||||||
hideChannelReactions = true;
|
showChannelReactions = true;
|
||||||
hideGroupReactions = true;
|
showGroupReactions = true;
|
||||||
|
|
||||||
// ~ Customization
|
// ~ Customization
|
||||||
appIcon =
|
appIcon =
|
||||||
|
@ -420,11 +420,11 @@ void set_localPremium(bool val) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_hideChannelReactions(bool val) {
|
void set_hideChannelReactions(bool val) {
|
||||||
settings->hideChannelReactions = val;
|
settings->showChannelReactions = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_hideGroupReactions(bool val) {
|
void set_hideGroupReactions(bool val) {
|
||||||
settings->hideGroupReactions = val;
|
settings->showGroupReactions = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_appIcon(const QString &val) {
|
void set_appIcon(const QString &val) {
|
||||||
|
|
|
@ -76,8 +76,8 @@ public:
|
||||||
|
|
||||||
bool disableNotificationsDelay;
|
bool disableNotificationsDelay;
|
||||||
bool localPremium;
|
bool localPremium;
|
||||||
bool hideChannelReactions;
|
bool showChannelReactions;
|
||||||
bool hideGroupReactions;
|
bool showGroupReactions;
|
||||||
|
|
||||||
QString appIcon;
|
QString appIcon;
|
||||||
bool simpleQuotesAndReplies;
|
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(showGhostToggleInTray)
|
||||||
NLOHMANN_JSON_TO(showStreamerToggleInTray)
|
NLOHMANN_JSON_TO(showStreamerToggleInTray)
|
||||||
NLOHMANN_JSON_TO(monoFont)
|
NLOHMANN_JSON_TO(monoFont)
|
||||||
NLOHMANN_JSON_TO(hideChannelReactions)
|
NLOHMANN_JSON_TO(showChannelReactions)
|
||||||
NLOHMANN_JSON_TO(hideGroupReactions)
|
NLOHMANN_JSON_TO(showGroupReactions)
|
||||||
NLOHMANN_JSON_TO(hideNotificationCounters)
|
NLOHMANN_JSON_TO(hideNotificationCounters)
|
||||||
NLOHMANN_JSON_TO(hideNotificationBadge)
|
NLOHMANN_JSON_TO(hideNotificationBadge)
|
||||||
NLOHMANN_JSON_TO(hideAllChatsFolder)
|
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(showGhostToggleInTray)
|
||||||
NLOHMANN_JSON_FROM_WITH_DEFAULT(showStreamerToggleInTray)
|
NLOHMANN_JSON_FROM_WITH_DEFAULT(showStreamerToggleInTray)
|
||||||
NLOHMANN_JSON_FROM_WITH_DEFAULT(monoFont)
|
NLOHMANN_JSON_FROM_WITH_DEFAULT(monoFont)
|
||||||
NLOHMANN_JSON_FROM_WITH_DEFAULT(hideChannelReactions)
|
NLOHMANN_JSON_FROM_WITH_DEFAULT(showChannelReactions)
|
||||||
NLOHMANN_JSON_FROM_WITH_DEFAULT(hideGroupReactions)
|
NLOHMANN_JSON_FROM_WITH_DEFAULT(showGroupReactions)
|
||||||
NLOHMANN_JSON_FROM_WITH_DEFAULT(hideNotificationCounters)
|
NLOHMANN_JSON_FROM_WITH_DEFAULT(hideNotificationCounters)
|
||||||
NLOHMANN_JSON_FROM_WITH_DEFAULT(hideNotificationBadge)
|
NLOHMANN_JSON_FROM_WITH_DEFAULT(hideNotificationBadge)
|
||||||
NLOHMANN_JSON_FROM_WITH_DEFAULT(hideAllChatsFolder)
|
NLOHMANN_JSON_FROM_WITH_DEFAULT(hideAllChatsFolder)
|
||||||
|
|
|
@ -855,12 +855,12 @@ void SetupQoLToggles(not_null<Ui::VerticalLayout*> container) {
|
||||||
tr::ayu_HideChannelReactions(),
|
tr::ayu_HideChannelReactions(),
|
||||||
st::settingsButtonNoIcon
|
st::settingsButtonNoIcon
|
||||||
)->toggleOn(
|
)->toggleOn(
|
||||||
rpl::single(!settings->hideChannelReactions)
|
rpl::single(!settings->showChannelReactions)
|
||||||
)->toggledValue(
|
)->toggledValue(
|
||||||
) | rpl::filter(
|
) | rpl::filter(
|
||||||
[=](bool enabled)
|
[=](bool enabled)
|
||||||
{
|
{
|
||||||
return (!enabled != settings->hideChannelReactions);
|
return (!enabled != settings->showChannelReactions);
|
||||||
}) | start_with_next(
|
}) | start_with_next(
|
||||||
[=](bool enabled)
|
[=](bool enabled)
|
||||||
{
|
{
|
||||||
|
@ -874,12 +874,12 @@ void SetupQoLToggles(not_null<Ui::VerticalLayout*> container) {
|
||||||
tr::ayu_HideGroupReactions(),
|
tr::ayu_HideGroupReactions(),
|
||||||
st::settingsButtonNoIcon
|
st::settingsButtonNoIcon
|
||||||
)->toggleOn(
|
)->toggleOn(
|
||||||
rpl::single(!settings->hideGroupReactions)
|
rpl::single(!settings->showGroupReactions)
|
||||||
)->toggledValue(
|
)->toggledValue(
|
||||||
) | rpl::filter(
|
) | rpl::filter(
|
||||||
[=](bool enabled)
|
[=](bool enabled)
|
||||||
{
|
{
|
||||||
return (!enabled != settings->hideGroupReactions);
|
return (!enabled != settings->showGroupReactions);
|
||||||
}) | start_with_next(
|
}) | start_with_next(
|
||||||
[=](bool enabled)
|
[=](bool enabled)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2429,8 +2429,8 @@ Dialogs::UnreadState History::computeUnreadState() const {
|
||||||
result.mentions = unreadMentions().has() ? 1 : 0;
|
result.mentions = unreadMentions().has() ? 1 : 0;
|
||||||
const auto peer = this->peer.get();
|
const auto peer = this->peer.get();
|
||||||
const auto &settings = AyuSettings::getInstance();
|
const auto &settings = AyuSettings::getInstance();
|
||||||
const auto hideReactions = (peer->isChannel() && !peer->isMegagroup() && !settings.hideChannelReactions)
|
const auto hideReactions = (peer->isChannel() && !peer->isMegagroup() && !settings.showChannelReactions)
|
||||||
|| (peer->isMegagroup() && !settings.hideGroupReactions);
|
|| (peer->isMegagroup() && !settings.showGroupReactions);
|
||||||
result.reactions = hideReactions ? 0 : (unreadReactions().has() ? 1 : 0);
|
result.reactions = hideReactions ? 0 : (unreadReactions().has() ? 1 : 0);
|
||||||
result.messagesMuted = muted ? result.messages : 0;
|
result.messagesMuted = muted ? result.messages : 0;
|
||||||
result.chatsMuted = muted ? result.chats : 0;
|
result.chatsMuted = muted ? result.chats : 0;
|
||||||
|
|
|
@ -1221,8 +1221,8 @@ void HistoryInner::paintEvent(QPaintEvent *e) {
|
||||||
if (markingAsViewed && item->hasUnwatchedEffect()) {
|
if (markingAsViewed && item->hasUnwatchedEffect()) {
|
||||||
const auto peer = item->history()->peer;
|
const auto peer = item->history()->peer;
|
||||||
const auto &settings = AyuSettings::getInstance();
|
const auto &settings = AyuSettings::getInstance();
|
||||||
const auto hide = (!settings.hideChannelReactions && peer->isChannel() && !peer->isMegagroup()) ||
|
const auto hide = (!settings.showChannelReactions && peer->isChannel() && !peer->isMegagroup()) ||
|
||||||
(!settings.hideGroupReactions && peer->isMegagroup());
|
(!settings.showGroupReactions && peer->isMegagroup());
|
||||||
if (!hide) {
|
if (!hide) {
|
||||||
startEffects.emplace(view);
|
startEffects.emplace(view);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1171,8 +1171,8 @@ void CheckReactionNotificationSchedule(
|
||||||
}
|
}
|
||||||
const auto peer = item->history()->peer;
|
const auto peer = item->history()->peer;
|
||||||
const auto &settings = AyuSettings::getInstance();
|
const auto &settings = AyuSettings::getInstance();
|
||||||
if ((peer->isChannel() && !peer->isMegagroup() && !settings.hideChannelReactions)
|
if ((peer->isChannel() && !peer->isMegagroup() && !settings.showChannelReactions)
|
||||||
|| (peer->isMegagroup() && !settings.hideGroupReactions)) {
|
|| (peer->isMegagroup() && !settings.showGroupReactions)) {
|
||||||
item->markEffectWatched();
|
item->markEffectWatched();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -835,12 +835,12 @@ InlineListData InlineListDataFromMessage(not_null<Element*> view) {
|
||||||
using Flag = InlineListData::Flag;
|
using Flag = InlineListData::Flag;
|
||||||
const auto item = view->data();
|
const auto item = view->data();
|
||||||
const auto &settings = AyuSettings::getInstance();
|
const auto &settings = AyuSettings::getInstance();
|
||||||
if (!settings.hideChannelReactions
|
if (!settings.showChannelReactions
|
||||||
&& item->history()->peer->isChannel()
|
&& item->history()->peer->isChannel()
|
||||||
&& !item->history()->peer->isMegagroup()) {
|
&& !item->history()->peer->isMegagroup()) {
|
||||||
return InlineListData();
|
return InlineListData();
|
||||||
}
|
}
|
||||||
if (!settings.hideGroupReactions
|
if (!settings.showGroupReactions
|
||||||
&& item->history()->peer->isMegagroup()) {
|
&& item->history()->peer->isMegagroup()) {
|
||||||
return InlineListData();
|
return InlineListData();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1358,8 +1358,8 @@ AttachSelectorResult AttachSelectorToMenu(
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto peer = item->history()->peer;
|
const auto peer = item->history()->peer;
|
||||||
if ((peer->isChannel() && !peer->isMegagroup() && !settings.hideChannelReactions)
|
if ((peer->isChannel() && !peer->isMegagroup() && !settings.showChannelReactions)
|
||||||
|| (peer->isMegagroup() && !settings.hideGroupReactions)) {
|
|| (peer->isMegagroup() && !settings.showGroupReactions)) {
|
||||||
return AttachSelectorResult::Skipped;
|
return AttachSelectorResult::Skipped;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue