mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Add a power saving setting for effects.
This commit is contained in:
@@ -22,6 +22,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "lottie/lottie_common.h"
|
||||
#include "lottie/lottie_single_player.h"
|
||||
#include "base/random.h"
|
||||
#include "ui/power_saving.h"
|
||||
#include "styles/style_chat.h"
|
||||
|
||||
namespace HistoryView {
|
||||
@@ -155,7 +156,8 @@ void EmojiInteractions::play(
|
||||
}
|
||||
|
||||
void EmojiInteractions::playEffectOnRead(not_null<const Element*> view) {
|
||||
if (view->data()->markEffectWatched()) {
|
||||
const auto flag = PowerSaving::Flag::kChatEffects;
|
||||
if (view->data()->markEffectWatched() && !PowerSaving::On(flag)) {
|
||||
playEffect(view);
|
||||
}
|
||||
}
|
||||
|
@@ -152,6 +152,7 @@ EditFlagsDescriptor<PowerSaving::Flags> PowerSavingLabels() {
|
||||
&st::menuIconChatBubble,
|
||||
},
|
||||
{ kChatSpoiler, tr::lng_settings_power_chat_spoiler(tr::now) },
|
||||
{ kChatEffects, tr::lng_settings_power_chat_effects(tr::now) },
|
||||
};
|
||||
auto calls = std::vector<Label>{
|
||||
{
|
||||
|
@@ -20,8 +20,9 @@ enum Flag : uint32 {
|
||||
kChatSpoiler = (1U << 7),
|
||||
kCalls = (1U << 8),
|
||||
kEmojiStatus = (1U << 9),
|
||||
kChatEffects = (1U << 10),
|
||||
|
||||
kAll = (1U << 10) - 1,
|
||||
kAll = (1U << 11) - 1,
|
||||
};
|
||||
inline constexpr bool is_flag_type(Flag) { return true; }
|
||||
using Flags = base::flags<Flag>;
|
||||
|
Reference in New Issue
Block a user