// This is the source code of AyuGram for Desktop. // // We do not and cannot prevent the use of our code, // but be respectful and credit the original author. // // Copyright @Radolyn, 2026 #pragma once #include "ayu/libs/json.hpp" #include "ayu/libs/json_ext.hpp" #include "rpl/lifetime.h" #include "rpl/producer.h" #include "rpl/variable.h" #include #include namespace Main { class Session; } enum class PeerIdDisplay { Hidden = 0, TelegramApi = 1, BotApi = 2, }; enum class ChannelBottomButton { Hidden = 0, MuteUnmute = 1, DiscussWithFallback = 2, }; enum class ContextMenuVisibility { Hidden = 0, Visible = 1, VisibleWithModifier = 2, }; enum class TranslationProvider { Telegram = 0, Google = 1, Yandex = 2, Native = 3, }; enum class SendWithoutSoundOption { Never = 0, InGhostMode = 1, Always = 2, }; NLOHMANN_JSON_SERIALIZE_ENUM(PeerIdDisplay, { {PeerIdDisplay::Hidden, 0}, {PeerIdDisplay::TelegramApi, 1}, {PeerIdDisplay::BotApi, 2}, }) NLOHMANN_JSON_SERIALIZE_ENUM(ChannelBottomButton, { {ChannelBottomButton::Hidden, 0}, {ChannelBottomButton::MuteUnmute, 1}, {ChannelBottomButton::DiscussWithFallback, 2}, }) NLOHMANN_JSON_SERIALIZE_ENUM(ContextMenuVisibility, { {ContextMenuVisibility::Hidden, 0}, {ContextMenuVisibility::Visible, 1}, {ContextMenuVisibility::VisibleWithModifier, 2}, }) NLOHMANN_JSON_SERIALIZE_ENUM(TranslationProvider, { {TranslationProvider::Telegram, "telegram"}, {TranslationProvider::Google, "google"}, {TranslationProvider::Yandex, "yandex"}, {TranslationProvider::Native, "native"}, }) NLOHMANN_JSON_SERIALIZE_ENUM(SendWithoutSoundOption, { {SendWithoutSoundOption::Never, 0}, {SendWithoutSoundOption::InGhostMode, 1}, {SendWithoutSoundOption::Always, 2}, }) class GhostModeAccountSettings { public: GhostModeAccountSettings(); [[nodiscard]] bool sendReadMessages() const { return _sendReadMessages.current(); } [[nodiscard]] bool sendReadStories() const { return _sendReadStories.current(); } [[nodiscard]] bool sendOnlinePackets() const { return _sendOnlinePackets.current(); } [[nodiscard]] bool sendUploadProgress() const { return _sendUploadProgress.current(); } [[nodiscard]] bool sendOfflinePacketAfterOnline() const { return _sendOfflinePacketAfterOnline.current(); } [[nodiscard]] bool markReadAfterAction() const { return _markReadAfterAction.current(); } [[nodiscard]] bool useScheduledMessages() const { return _useScheduledMessages.current(); } [[nodiscard]] SendWithoutSoundOption sendWithoutSound() const { return _sendWithoutSound.current(); } [[nodiscard]] bool shouldSendWithoutSound() const; [[nodiscard]] bool suggestGhostModeBeforeViewingStory() const { return _suggestGhostModeBeforeViewingStory.current(); } [[nodiscard]] bool isGhostModeActive() const { return _ghostModeActive.current(); } [[nodiscard]] bool isUseScheduledMessages() const { return isGhostModeActive() && useScheduledMessages(); } [[nodiscard]] bool sendReadMessagesLocked() const { return _sendReadMessagesLocked.current(); } [[nodiscard]] bool sendReadStoriesLocked() const { return _sendReadStoriesLocked.current(); } [[nodiscard]] bool sendOnlinePacketsLocked() const { return _sendOnlinePacketsLocked.current(); } [[nodiscard]] bool sendUploadProgressLocked() const { return _sendUploadProgressLocked.current(); } [[nodiscard]] bool sendOfflinePacketAfterOnlineLocked() const { return _sendOfflinePacketAfterOnlineLocked.current(); } void setSendReadMessages(bool val); void setSendReadStories(bool val); void setSendOnlinePackets(bool val); void setSendUploadProgress(bool val); void setSendOfflinePacketAfterOnline(bool val); void setMarkReadAfterAction(bool val); void setUseScheduledMessages(bool val); void setSendWithoutSound(SendWithoutSoundOption val); void setSuggestGhostModeBeforeViewingStory(bool val); void setGhostModeEnabled(bool val); void setSendReadMessagesLocked(bool val); void setSendReadStoriesLocked(bool val); void setSendOnlinePacketsLocked(bool val); void setSendUploadProgressLocked(bool val); void setSendOfflinePacketAfterOnlineLocked(bool val); [[nodiscard]] rpl::producer sendReadMessagesValue() const { return _sendReadMessages.value(); } [[nodiscard]] rpl::producer sendReadMessagesChanges() const { return _sendReadMessages.changes(); } [[nodiscard]] rpl::producer sendReadStoriesValue() const { return _sendReadStories.value(); } [[nodiscard]] rpl::producer sendReadStoriesChanges() const { return _sendReadStories.changes(); } [[nodiscard]] rpl::producer sendOnlinePacketsValue() const { return _sendOnlinePackets.value(); } [[nodiscard]] rpl::producer sendOnlinePacketsChanges() const { return _sendOnlinePackets.changes(); } [[nodiscard]] rpl::producer sendUploadProgressValue() const { return _sendUploadProgress.value(); } [[nodiscard]] rpl::producer sendUploadProgressChanges() const { return _sendUploadProgress.changes(); } [[nodiscard]] rpl::producer sendOfflinePacketAfterOnlineValue() const { return _sendOfflinePacketAfterOnline.value(); } [[nodiscard]] rpl::producer sendOfflinePacketAfterOnlineChanges() const { return _sendOfflinePacketAfterOnline.changes(); } [[nodiscard]] rpl::producer markReadAfterActionValue() const { return _markReadAfterAction.value(); } [[nodiscard]] rpl::producer markReadAfterActionChanges() const { return _markReadAfterAction.changes(); } [[nodiscard]] rpl::producer useScheduledMessagesValue() const { return _useScheduledMessages.value(); } [[nodiscard]] rpl::producer useScheduledMessagesChanges() const { return _useScheduledMessages.changes(); } [[nodiscard]] rpl::producer sendWithoutSoundValue() const { return _sendWithoutSound.value(); } [[nodiscard]] rpl::producer sendWithoutSoundChanges() const { return _sendWithoutSound.changes(); } [[nodiscard]] rpl::producer suggestGhostModeBeforeViewingStoryValue() const { return _suggestGhostModeBeforeViewingStory.value(); } [[nodiscard]] rpl::producer suggestGhostModeBeforeViewingStoryChanges() const { return _suggestGhostModeBeforeViewingStory.changes(); } [[nodiscard]] rpl::producer ghostModeActiveValue() const { return _ghostModeActive.value(); } [[nodiscard]] rpl::producer ghostModeActiveChanges() const { return _ghostModeActive.changes(); } [[nodiscard]] rpl::producer sendReadMessagesLockedValue() const { return _sendReadMessagesLocked.value(); } [[nodiscard]] rpl::producer sendReadMessagesLockedChanges() const { return _sendReadMessagesLocked.changes(); } [[nodiscard]] rpl::producer sendReadStoriesLockedValue() const { return _sendReadStoriesLocked.value(); } [[nodiscard]] rpl::producer sendReadStoriesLockedChanges() const { return _sendReadStoriesLocked.changes(); } [[nodiscard]] rpl::producer sendOnlinePacketsLockedValue() const { return _sendOnlinePacketsLocked.value(); } [[nodiscard]] rpl::producer sendOnlinePacketsLockedChanges() const { return _sendOnlinePacketsLocked.changes(); } [[nodiscard]] rpl::producer sendUploadProgressLockedValue() const { return _sendUploadProgressLocked.value(); } [[nodiscard]] rpl::producer sendUploadProgressLockedChanges() const { return _sendUploadProgressLocked.changes(); } [[nodiscard]] rpl::producer sendOfflinePacketAfterOnlineLockedValue() const { return _sendOfflinePacketAfterOnlineLocked.value(); } [[nodiscard]] rpl::producer sendOfflinePacketAfterOnlineLockedChanges() const { return _sendOfflinePacketAfterOnlineLocked.changes(); } friend void to_json(nlohmann::json &j, const GhostModeAccountSettings &s); friend void from_json(const nlohmann::json &j, GhostModeAccountSettings &s); private: friend class AyuSettings; rpl::variable _sendReadMessages = true; rpl::variable _sendReadStories = true; rpl::variable _sendOnlinePackets = true; rpl::variable _sendUploadProgress = true; rpl::variable _sendOfflinePacketAfterOnline = false; rpl::variable _markReadAfterAction = true; rpl::variable _useScheduledMessages = false; rpl::variable _sendWithoutSound = SendWithoutSoundOption::Never; rpl::variable _suggestGhostModeBeforeViewingStory = true; rpl::variable _ghostModeActive = false; rpl::variable _sendReadMessagesLocked = false; rpl::variable _sendReadStoriesLocked = false; rpl::variable _sendOnlinePacketsLocked = false; rpl::variable _sendUploadProgressLocked = false; rpl::variable _sendOfflinePacketAfterOnlineLocked = false; }; void to_json(nlohmann::json &j, const GhostModeAccountSettings &s); void from_json(const nlohmann::json &j, GhostModeAccountSettings &s); class MessageShotSettings { public: [[nodiscard]] bool showBackground() const { return _showBackground.current(); } [[nodiscard]] bool showDate() const { return _showDate.current(); } [[nodiscard]] bool showReactions() const { return _showReactions.current(); } [[nodiscard]] bool showHeaderDecorations() const { return _showHeaderDecorations.current(); } [[nodiscard]] bool showColorfulReplies() const { return _showColorfulReplies.current(); } [[nodiscard]] bool revealSpoilers() const { return _revealSpoilers.current(); } [[nodiscard]] int embeddedThemeType() const { return _embeddedThemeType.current(); } [[nodiscard]] uint32 embeddedThemeAccentColor() const { return _embeddedThemeAccentColor.current(); } [[nodiscard]] uint64 cloudThemeId() const { return _cloudThemeId.current(); } [[nodiscard]] uint64 cloudThemeAccessHash() const { return _cloudThemeAccessHash.current(); } [[nodiscard]] uint64 cloudThemeDocumentId() const { return _cloudThemeDocumentId.current(); } [[nodiscard]] const QString &cloudThemeTitle() const { return _cloudThemeTitle.current(); } [[nodiscard]] uint64 cloudThemeAccountId() const { return _cloudThemeAccountId.current(); } void setShowBackground(bool val); void setShowDate(bool val); void setShowReactions(bool val); void setShowHeaderDecorations(bool val); void setShowColorfulReplies(bool val); void setRevealSpoilers(bool val); void setEmbeddedTheme(int type, uint32 accentColor = 0); void setCloudTheme(uint64 accountId, uint64 id, uint64 accessHash, uint64 documentId, const QString &title); void clearTheme(); friend void to_json(nlohmann::json &j, const MessageShotSettings &s); friend void from_json(const nlohmann::json &j, MessageShotSettings &s); private: friend class AyuSettings; [[nodiscard]] bool isCloudThemeEmpty() const; void clearCloudThemeData(); rpl::variable _showBackground = true; rpl::variable _showDate = false; rpl::variable _showReactions = false; rpl::variable _showHeaderDecorations = true; rpl::variable _showColorfulReplies = true; rpl::variable _revealSpoilers = true; rpl::variable _embeddedThemeType = -1; rpl::variable _embeddedThemeAccentColor = 0; rpl::variable _cloudThemeId = 0; rpl::variable _cloudThemeAccessHash = 0; rpl::variable _cloudThemeDocumentId = 0; rpl::variable _cloudThemeTitle; rpl::variable _cloudThemeAccountId = 0; }; void to_json(nlohmann::json &j, const MessageShotSettings &s); void from_json(const nlohmann::json &j, MessageShotSettings &s); class AyuSettings { public: AyuSettings(const AyuSettings &) = delete; AyuSettings &operator=(const AyuSettings &) = delete; AyuSettings(AyuSettings &&) noexcept = default; AyuSettings &operator=(AyuSettings &&) noexcept = default; [[nodiscard]] static AyuSettings &getInstance(); static void load(); static void save(); static void reset(); [[nodiscard]] static GhostModeAccountSettings &ghost(not_null session); [[nodiscard]] static GhostModeAccountSettings &ghost(uint64 userId); [[nodiscard]] static GhostModeAccountSettings &ghost(); [[nodiscard]] bool useGlobalGhostMode() const { return _useGlobalGhostMode.current(); } void setUseGlobalGhostMode(bool val); [[nodiscard]] MessageShotSettings &messageShotSettings() { return _messageShotSettings; } [[nodiscard]] const MessageShotSettings &messageShotSettings() const { return _messageShotSettings; } void addShadowBan(int64 id); void removeShadowBan(int64 id); [[nodiscard]] bool isShadowBanned(const int64 id) const { return _shadowBanIds.contains(id); } [[nodiscard]] const std::unordered_set &shadowBanIds() const { return _shadowBanIds; } void validate(); [[nodiscard]] bool saveDeletedMessages() const { return _saveDeletedMessages.current(); } [[nodiscard]] bool saveMessagesHistory() const { return _saveMessagesHistory.current(); } [[nodiscard]] bool saveForBots() const { return _saveForBots.current(); } [[nodiscard]] bool filtersEnabled() const { return _filtersEnabled.current(); } [[nodiscard]] bool filtersEnabledInChats() const { return _filtersEnabledInChats.current(); } [[nodiscard]] bool hideFromBlocked() const { return _hideFromBlocked.current(); } [[nodiscard]] bool semiTransparentDeletedMessages() const { return _semiTransparentDeletedMessages.current(); } [[nodiscard]] bool disableAds() const { return _disableAds.current(); } [[nodiscard]] bool disableStories() const { return _disableStories.current(); } [[nodiscard]] bool disableCustomBackgrounds() const { return _disableCustomBackgrounds.current(); } [[nodiscard]] bool hidePremiumStatuses() const { return _hidePremiumStatuses.current(); } [[nodiscard]] bool showOnlyAddedEmojisAndStickers() const { return _showOnlyAddedEmojisAndStickers.current(); } [[nodiscard]] bool collapseSimilarChannels() const { return _collapseSimilarChannels.current(); } [[nodiscard]] bool hideSimilarChannels() const { return _hideSimilarChannels.current(); } [[nodiscard]] int messageBubbleRadius() const { return _messageBubbleRadius.current(); } [[nodiscard]] bool disableOpenLinkWarning() const { return _disableOpenLinkWarning.current(); } [[nodiscard]] double wideMultiplier() const { return _wideMultiplier.current(); } [[nodiscard]] bool spoofWebviewAsAndroid() const { return _spoofWebviewAsAndroid.current(); } [[nodiscard]] bool increaseWebviewHeight() const { return _increaseWebviewHeight.current(); } [[nodiscard]] bool increaseWebviewWidth() const { return _increaseWebviewWidth.current(); } [[nodiscard]] bool materialSwitches() const { return _materialSwitches.current(); } [[nodiscard]] bool removeMessageTail() const { return _removeMessageTail.current(); } [[nodiscard]] bool disableNotificationsDelay() const { return _disableNotificationsDelay.current(); } [[nodiscard]] bool localPremium() const { return _localPremium.current(); } [[nodiscard]] bool showChannelReactions() const { return _showChannelReactions.current(); } [[nodiscard]] bool showGroupReactions() const { return _showGroupReactions.current(); } [[nodiscard]] bool showPrivateChatReactions() const { return _showPrivateChatReactions.current(); } [[nodiscard]] const QString &appIcon() const { return _appIcon.current(); } [[nodiscard]] bool simpleQuotesAndReplies() const { return _simpleQuotesAndReplies.current(); } [[nodiscard]] bool hideFastShare() const { return _hideFastShare.current(); } [[nodiscard]] bool replaceBottomInfoWithIcons() const { return _replaceBottomInfoWithIcons.current(); } [[nodiscard]] const QString &deletedMark() const { return _deletedMark.current(); } [[nodiscard]] const QString &editedMark() const { return _editedMark.current(); } [[nodiscard]] int recentStickersCount() const { return _recentStickersCount.current(); } [[nodiscard]] ContextMenuVisibility showReactionsPanelInContextMenu() const { return _showReactionsPanelInContextMenu.current(); } [[nodiscard]] ContextMenuVisibility showViewsPanelInContextMenu() const { return _showViewsPanelInContextMenu.current(); } [[nodiscard]] ContextMenuVisibility showHideMessageInContextMenu() const { return _showHideMessageInContextMenu.current(); } [[nodiscard]] ContextMenuVisibility showUserMessagesInContextMenu() const { return _showUserMessagesInContextMenu.current(); } [[nodiscard]] ContextMenuVisibility showMessageDetailsInContextMenu() const { return _showMessageDetailsInContextMenu.current(); } [[nodiscard]] ContextMenuVisibility showRepeatMessageInContextMenu() const { return _showRepeatMessageInContextMenu.current(); } [[nodiscard]] ContextMenuVisibility showAddFilterInContextMenu() const { return _showAddFilterInContextMenu.current(); } [[nodiscard]] bool showAttachButtonInMessageField() const { return _showAttachButtonInMessageField.current(); } [[nodiscard]] bool showCommandsButtonInMessageField() const { return _showCommandsButtonInMessageField.current(); } [[nodiscard]] bool showEmojiButtonInMessageField() const { return _showEmojiButtonInMessageField.current(); } [[nodiscard]] bool showMicrophoneButtonInMessageField() const { return _showMicrophoneButtonInMessageField.current(); } [[nodiscard]] bool showAutoDeleteButtonInMessageField() const { return _showAutoDeleteButtonInMessageField.current(); } [[nodiscard]] bool showGiftButtonInMessageField() const { return _showGiftButtonInMessageField.current(); } [[nodiscard]] bool showAiEditorButtonInMessageField() const { return _showAiEditorButtonInMessageField.current(); } [[nodiscard]] bool showAttachPopup() const { return _showAttachPopup.current(); } [[nodiscard]] bool showEmojiPopup() const { return _showEmojiPopup.current(); } [[nodiscard]] bool showMyProfileInDrawer() const { return _showMyProfileInDrawer.current(); } [[nodiscard]] bool showBotsInDrawer() const { return _showBotsInDrawer.current(); } [[nodiscard]] bool showNewGroupInDrawer() const { return _showNewGroupInDrawer.current(); } [[nodiscard]] bool showNewChannelInDrawer() const { return _showNewChannelInDrawer.current(); } [[nodiscard]] bool showContactsInDrawer() const { return _showContactsInDrawer.current(); } [[nodiscard]] bool showCallsInDrawer() const { return _showCallsInDrawer.current(); } [[nodiscard]] bool showSavedMessagesInDrawer() const { return _showSavedMessagesInDrawer.current(); } [[nodiscard]] bool showLReadToggleInDrawer() const { return _showLReadToggleInDrawer.current(); } [[nodiscard]] bool showSReadToggleInDrawer() const { return _showSReadToggleInDrawer.current(); } [[nodiscard]] bool showNightModeToggleInDrawer() const { return _showNightModeToggleInDrawer.current(); } [[nodiscard]] bool showGhostToggleInDrawer() const { return _showGhostToggleInDrawer.current(); } [[nodiscard]] bool showStreamerToggleInDrawer() const { return _showStreamerToggleInDrawer.current(); } [[nodiscard]] bool showGhostToggleInTray() const { return _showGhostToggleInTray.current(); } [[nodiscard]] bool showStreamerToggleInTray() const { return _showStreamerToggleInTray.current(); } [[nodiscard]] const QString &monoFont() const { return _monoFont.current(); } [[nodiscard]] bool hideNotificationCounters() const { return _hideNotificationCounters.current(); } [[nodiscard]] bool hideNotificationBadge() const { return _hideNotificationBadge.current(); } [[nodiscard]] bool hideAllChatsFolder() const { return _hideAllChatsFolder.current(); } [[nodiscard]] ChannelBottomButton channelBottomButton() const { return _channelBottomButton.current(); } [[nodiscard]] bool quickAdminShortcuts() const { return _quickAdminShortcuts.current(); } [[nodiscard]] bool disableGreetingSticker() const { return _disableGreetingSticker.current(); } [[nodiscard]] PeerIdDisplay showPeerId() const { return _showPeerId.current(); } [[nodiscard]] bool showMessageSeconds() const { return _showMessageSeconds.current(); } [[nodiscard]] bool showMessageShot() const { return _showMessageShot.current(); } [[nodiscard]] bool filterZalgo() const { return _filterZalgo.current(); } [[nodiscard]] bool stickerConfirmation() const { return _stickerConfirmation.current(); } [[nodiscard]] bool gifConfirmation() const { return _gifConfirmation.current(); } [[nodiscard]] bool voiceConfirmation() const { return _voiceConfirmation.current(); } [[nodiscard]] TranslationProvider translationProvider() const { return _translationProvider.current(); } [[nodiscard]] bool adaptiveCoverColor() const { return _adaptiveCoverColor.current(); } [[nodiscard]] bool improveLinkPreviews() const { return _improveLinkPreviews.current(); } [[nodiscard]] bool crashReporting() const { return _crashReporting.current(); } [[nodiscard]] int avatarCorners() const { return _avatarCorners.current(); } [[nodiscard]] bool singleCornerRadius() const { return _singleCornerRadius.current(); } void setSaveDeletedMessages(bool val); void setSaveMessagesHistory(bool val); void setSaveForBots(bool val); void setFiltersEnabled(bool val); void setFiltersEnabledInChats(bool val); void setHideFromBlocked(bool val); void setSemiTransparentDeletedMessages(bool val); void setDisableAds(bool val); void setDisableStories(bool val); void setDisableCustomBackgrounds(bool val); void setHidePremiumStatuses(bool val); void setShowOnlyAddedEmojisAndStickers(bool val); void setCollapseSimilarChannels(bool val); void setHideSimilarChannels(bool val); void setMessageBubbleRadius(int val); void setDisableOpenLinkWarning(bool val); void setWideMultiplier(double val); void setSpoofWebviewAsAndroid(bool val); void setIncreaseWebviewHeight(bool val); void setIncreaseWebviewWidth(bool val); void setMaterialSwitches(bool val); void setRemoveMessageTail(bool val); void setDisableNotificationsDelay(bool val); void setLocalPremium(bool val); void setShowChannelReactions(bool val); void setShowGroupReactions(bool val); void setShowPrivateChatReactions(bool val); void setAppIcon(const QString &val); void setSimpleQuotesAndReplies(bool val); void setHideFastShare(bool val); void setReplaceBottomInfoWithIcons(bool val); void setDeletedMark(const QString &val); void setEditedMark(const QString &val); void setRecentStickersCount(int val); void setShowReactionsPanelInContextMenu(ContextMenuVisibility val); void setShowViewsPanelInContextMenu(ContextMenuVisibility val); void setShowHideMessageInContextMenu(ContextMenuVisibility val); void setShowUserMessagesInContextMenu(ContextMenuVisibility val); void setShowMessageDetailsInContextMenu(ContextMenuVisibility val); void setShowRepeatMessageInContextMenu(ContextMenuVisibility val); void setShowAddFilterInContextMenu(ContextMenuVisibility val); void setShowAttachButtonInMessageField(bool val); void setShowCommandsButtonInMessageField(bool val); void setShowEmojiButtonInMessageField(bool val); void setShowMicrophoneButtonInMessageField(bool val); void setShowAutoDeleteButtonInMessageField(bool val); void setShowGiftButtonInMessageField(bool val); void setShowAiEditorButtonInMessageField(bool val); void setShowAttachPopup(bool val); void setShowEmojiPopup(bool val); void setShowMyProfileInDrawer(bool val); void setShowBotsInDrawer(bool val); void setShowNewGroupInDrawer(bool val); void setShowNewChannelInDrawer(bool val); void setShowContactsInDrawer(bool val); void setShowCallsInDrawer(bool val); void setShowSavedMessagesInDrawer(bool val); void setShowLReadToggleInDrawer(bool val); void setShowSReadToggleInDrawer(bool val); void setShowNightModeToggleInDrawer(bool val); void setShowGhostToggleInDrawer(bool val); void setShowStreamerToggleInDrawer(bool val); void setShowGhostToggleInTray(bool val); void setShowStreamerToggleInTray(bool val); void setMonoFont(const QString &val); void setHideNotificationCounters(bool val); void setHideNotificationBadge(bool val); void setHideAllChatsFolder(bool val); void setChannelBottomButton(ChannelBottomButton val); void setQuickAdminShortcuts(bool val); void setDisableGreetingSticker(bool val); void setShowPeerId(PeerIdDisplay val); void setShowMessageSeconds(bool val); void setShowMessageShot(bool val); void setFilterZalgo(bool val); void setStickerConfirmation(bool val); void setGifConfirmation(bool val); void setVoiceConfirmation(bool val); void setTranslationProvider(TranslationProvider val); void setAdaptiveCoverColor(bool val); void setImproveLinkPreviews(bool val); void setCrashReporting(bool val); void setAvatarCorners(int val); void setSingleCornerRadius(bool val); [[nodiscard]] rpl::producer useGlobalGhostModeValue() const { return _useGlobalGhostMode.value(); } [[nodiscard]] rpl::producer useGlobalGhostModeChanges() const { return _useGlobalGhostMode.changes(); } [[nodiscard]] rpl::producer saveDeletedMessagesValue() const { return _saveDeletedMessages.value(); } [[nodiscard]] rpl::producer saveDeletedMessagesChanges() const { return _saveDeletedMessages.changes(); } [[nodiscard]] rpl::producer saveMessagesHistoryValue() const { return _saveMessagesHistory.value(); } [[nodiscard]] rpl::producer saveMessagesHistoryChanges() const { return _saveMessagesHistory.changes(); } [[nodiscard]] rpl::producer saveForBotsValue() const { return _saveForBots.value(); } [[nodiscard]] rpl::producer saveForBotsChanges() const { return _saveForBots.changes(); } [[nodiscard]] rpl::producer filtersEnabledValue() const { return _filtersEnabled.value(); } [[nodiscard]] rpl::producer filtersEnabledChanges() const { return _filtersEnabled.changes(); } [[nodiscard]] rpl::producer filtersEnabledInChatsValue() const { return _filtersEnabledInChats.value(); } [[nodiscard]] rpl::producer filtersEnabledInChatsChanges() const { return _filtersEnabledInChats.changes(); } [[nodiscard]] rpl::producer hideFromBlockedValue() const { return _hideFromBlocked.value(); } [[nodiscard]] rpl::producer hideFromBlockedChanges() const { return _hideFromBlocked.changes(); } [[nodiscard]] rpl::producer semiTransparentDeletedMessagesValue() const { return _semiTransparentDeletedMessages.value(); } [[nodiscard]] rpl::producer semiTransparentDeletedMessagesChanges() const { return _semiTransparentDeletedMessages.changes(); } [[nodiscard]] rpl::producer disableAdsValue() const { return _disableAds.value(); } [[nodiscard]] rpl::producer disableAdsChanges() const { return _disableAds.changes(); } [[nodiscard]] rpl::producer disableStoriesValue() const { return _disableStories.value(); } [[nodiscard]] rpl::producer disableStoriesChanges() const { return _disableStories.changes(); } [[nodiscard]] rpl::producer disableCustomBackgroundsValue() const { return _disableCustomBackgrounds.value(); } [[nodiscard]] rpl::producer disableCustomBackgroundsChanges() const { return _disableCustomBackgrounds.changes(); } [[nodiscard]] rpl::producer hidePremiumStatusesValue() const { return _hidePremiumStatuses.value(); } [[nodiscard]] rpl::producer hidePremiumStatusesChanges() const { return _hidePremiumStatuses.changes(); } [[nodiscard]] rpl::producer showOnlyAddedEmojisAndStickersValue() const { return _showOnlyAddedEmojisAndStickers.value(); } [[nodiscard]] rpl::producer showOnlyAddedEmojisAndStickersChanges() const { return _showOnlyAddedEmojisAndStickers.changes(); } [[nodiscard]] rpl::producer collapseSimilarChannelsValue() const { return _collapseSimilarChannels.value(); } [[nodiscard]] rpl::producer collapseSimilarChannelsChanges() const { return _collapseSimilarChannels.changes(); } [[nodiscard]] rpl::producer hideSimilarChannelsValue() const { return _hideSimilarChannels.value(); } [[nodiscard]] rpl::producer hideSimilarChannelsChanges() const { return _hideSimilarChannels.changes(); } [[nodiscard]] rpl::producer messageBubbleRadiusValue() const { return _messageBubbleRadius.value(); } [[nodiscard]] rpl::producer messageBubbleRadiusChanges() const { return _messageBubbleRadius.changes(); } [[nodiscard]] rpl::producer disableOpenLinkWarningValue() const { return _disableOpenLinkWarning.value(); } [[nodiscard]] rpl::producer disableOpenLinkWarningChanges() const { return _disableOpenLinkWarning.changes(); } [[nodiscard]] rpl::producer wideMultiplierValue() const { return _wideMultiplier.value(); } [[nodiscard]] rpl::producer wideMultiplierChanges() const { return _wideMultiplier.changes(); } [[nodiscard]] rpl::producer spoofWebviewAsAndroidValue() const { return _spoofWebviewAsAndroid.value(); } [[nodiscard]] rpl::producer spoofWebviewAsAndroidChanges() const { return _spoofWebviewAsAndroid.changes(); } [[nodiscard]] rpl::producer increaseWebviewHeightValue() const { return _increaseWebviewHeight.value(); } [[nodiscard]] rpl::producer increaseWebviewHeightChanges() const { return _increaseWebviewHeight.changes(); } [[nodiscard]] rpl::producer increaseWebviewWidthValue() const { return _increaseWebviewWidth.value(); } [[nodiscard]] rpl::producer increaseWebviewWidthChanges() const { return _increaseWebviewWidth.changes(); } [[nodiscard]] rpl::producer materialSwitchesValue() const { return _materialSwitches.value(); } [[nodiscard]] rpl::producer materialSwitchesChanges() const { return _materialSwitches.changes(); } [[nodiscard]] rpl::producer removeMessageTailValue() const { return _removeMessageTail.value(); } [[nodiscard]] rpl::producer removeMessageTailChanges() const { return _removeMessageTail.changes(); } [[nodiscard]] rpl::producer disableNotificationsDelayValue() const { return _disableNotificationsDelay.value(); } [[nodiscard]] rpl::producer disableNotificationsDelayChanges() const { return _disableNotificationsDelay.changes(); } [[nodiscard]] rpl::producer localPremiumValue() const { return _localPremium.value(); } [[nodiscard]] rpl::producer localPremiumChanges() const { return _localPremium.changes(); } [[nodiscard]] rpl::producer showChannelReactionsValue() const { return _showChannelReactions.value(); } [[nodiscard]] rpl::producer showChannelReactionsChanges() const { return _showChannelReactions.changes(); } [[nodiscard]] rpl::producer showGroupReactionsValue() const { return _showGroupReactions.value(); } [[nodiscard]] rpl::producer showGroupReactionsChanges() const { return _showGroupReactions.changes(); } [[nodiscard]] rpl::producer showPrivateChatReactionsValue() const { return _showPrivateChatReactions.value(); } [[nodiscard]] rpl::producer showPrivateChatReactionsChanges() const { return _showPrivateChatReactions.changes(); } [[nodiscard]] rpl::producer appIconValue() const { return _appIcon.value(); } [[nodiscard]] rpl::producer appIconChanges() const { return _appIcon.changes(); } [[nodiscard]] rpl::producer simpleQuotesAndRepliesValue() const { return _simpleQuotesAndReplies.value(); } [[nodiscard]] rpl::producer simpleQuotesAndRepliesChanges() const { return _simpleQuotesAndReplies.changes(); } [[nodiscard]] rpl::producer hideFastShareValue() const { return _hideFastShare.value(); } [[nodiscard]] rpl::producer hideFastShareChanges() const { return _hideFastShare.changes(); } [[nodiscard]] rpl::producer replaceBottomInfoWithIconsValue() const { return _replaceBottomInfoWithIcons.value(); } [[nodiscard]] rpl::producer replaceBottomInfoWithIconsChanges() const { return _replaceBottomInfoWithIcons.changes(); } [[nodiscard]] rpl::producer deletedMarkValue() const { return _deletedMark.value(); } [[nodiscard]] rpl::producer deletedMarkChanges() const { return _deletedMark.changes(); } [[nodiscard]] rpl::producer editedMarkValue() const { return _editedMark.value(); } [[nodiscard]] rpl::producer editedMarkChanges() const { return _editedMark.changes(); } [[nodiscard]] rpl::producer recentStickersCountValue() const { return _recentStickersCount.value(); } [[nodiscard]] rpl::producer recentStickersCountChanges() const { return _recentStickersCount.changes(); } [[nodiscard]] rpl::producer showReactionsPanelInContextMenuValue() const { return _showReactionsPanelInContextMenu.value(); } [[nodiscard]] rpl::producer showReactionsPanelInContextMenuChanges() const { return _showReactionsPanelInContextMenu.changes(); } [[nodiscard]] rpl::producer showViewsPanelInContextMenuValue() const { return _showViewsPanelInContextMenu.value(); } [[nodiscard]] rpl::producer showViewsPanelInContextMenuChanges() const { return _showViewsPanelInContextMenu.changes(); } [[nodiscard]] rpl::producer showHideMessageInContextMenuValue() const { return _showHideMessageInContextMenu.value(); } [[nodiscard]] rpl::producer showHideMessageInContextMenuChanges() const { return _showHideMessageInContextMenu.changes(); } [[nodiscard]] rpl::producer showUserMessagesInContextMenuValue() const { return _showUserMessagesInContextMenu.value(); } [[nodiscard]] rpl::producer showUserMessagesInContextMenuChanges() const { return _showUserMessagesInContextMenu.changes(); } [[nodiscard]] rpl::producer showMessageDetailsInContextMenuValue() const { return _showMessageDetailsInContextMenu.value(); } [[nodiscard]] rpl::producer showMessageDetailsInContextMenuChanges() const { return _showMessageDetailsInContextMenu.changes(); } [[nodiscard]] rpl::producer showRepeatMessageInContextMenuValue() const { return _showRepeatMessageInContextMenu.value(); } [[nodiscard]] rpl::producer showRepeatMessageInContextMenuChanges() const { return _showRepeatMessageInContextMenu.changes(); } [[nodiscard]] rpl::producer showAddFilterInContextMenuValue() const { return _showAddFilterInContextMenu.value(); } [[nodiscard]] rpl::producer showAddFilterInContextMenuChanges() const { return _showAddFilterInContextMenu.changes(); } [[nodiscard]] rpl::producer showAttachButtonInMessageFieldValue() const { return _showAttachButtonInMessageField.value(); } [[nodiscard]] rpl::producer showAttachButtonInMessageFieldChanges() const { return _showAttachButtonInMessageField.changes(); } [[nodiscard]] rpl::producer showCommandsButtonInMessageFieldValue() const { return _showCommandsButtonInMessageField.value(); } [[nodiscard]] rpl::producer showCommandsButtonInMessageFieldChanges() const { return _showCommandsButtonInMessageField.changes(); } [[nodiscard]] rpl::producer showEmojiButtonInMessageFieldValue() const { return _showEmojiButtonInMessageField.value(); } [[nodiscard]] rpl::producer showEmojiButtonInMessageFieldChanges() const { return _showEmojiButtonInMessageField.changes(); } [[nodiscard]] rpl::producer showMicrophoneButtonInMessageFieldValue() const { return _showMicrophoneButtonInMessageField.value(); } [[nodiscard]] rpl::producer showMicrophoneButtonInMessageFieldChanges() const { return _showMicrophoneButtonInMessageField.changes(); } [[nodiscard]] rpl::producer showAutoDeleteButtonInMessageFieldValue() const { return _showAutoDeleteButtonInMessageField.value(); } [[nodiscard]] rpl::producer showAutoDeleteButtonInMessageFieldChanges() const { return _showAutoDeleteButtonInMessageField.changes(); } [[nodiscard]] rpl::producer showGiftButtonInMessageFieldValue() const { return _showGiftButtonInMessageField.value(); } [[nodiscard]] rpl::producer showGiftButtonInMessageFieldChanges() const { return _showGiftButtonInMessageField.changes(); } [[nodiscard]] rpl::producer showAiEditorButtonInMessageFieldValue() const { return _showAiEditorButtonInMessageField.value(); } [[nodiscard]] rpl::producer showAiEditorButtonInMessageFieldChanges() const { return _showAiEditorButtonInMessageField.changes(); } [[nodiscard]] rpl::producer showAttachPopupValue() const { return _showAttachPopup.value(); } [[nodiscard]] rpl::producer showAttachPopupChanges() const { return _showAttachPopup.changes(); } [[nodiscard]] rpl::producer showEmojiPopupValue() const { return _showEmojiPopup.value(); } [[nodiscard]] rpl::producer showEmojiPopupChanges() const { return _showEmojiPopup.changes(); } [[nodiscard]] rpl::producer showMyProfileInDrawerValue() const { return _showMyProfileInDrawer.value(); } [[nodiscard]] rpl::producer showMyProfileInDrawerChanges() const { return _showMyProfileInDrawer.changes(); } [[nodiscard]] rpl::producer showBotsInDrawerValue() const { return _showBotsInDrawer.value(); } [[nodiscard]] rpl::producer showBotsInDrawerChanges() const { return _showBotsInDrawer.changes(); } [[nodiscard]] rpl::producer showNewGroupInDrawerValue() const { return _showNewGroupInDrawer.value(); } [[nodiscard]] rpl::producer showNewGroupInDrawerChanges() const { return _showNewGroupInDrawer.changes(); } [[nodiscard]] rpl::producer showNewChannelInDrawerValue() const { return _showNewChannelInDrawer.value(); } [[nodiscard]] rpl::producer showNewChannelInDrawerChanges() const { return _showNewChannelInDrawer.changes(); } [[nodiscard]] rpl::producer showContactsInDrawerValue() const { return _showContactsInDrawer.value(); } [[nodiscard]] rpl::producer showContactsInDrawerChanges() const { return _showContactsInDrawer.changes(); } [[nodiscard]] rpl::producer showCallsInDrawerValue() const { return _showCallsInDrawer.value(); } [[nodiscard]] rpl::producer showCallsInDrawerChanges() const { return _showCallsInDrawer.changes(); } [[nodiscard]] rpl::producer showSavedMessagesInDrawerValue() const { return _showSavedMessagesInDrawer.value(); } [[nodiscard]] rpl::producer showSavedMessagesInDrawerChanges() const { return _showSavedMessagesInDrawer.changes(); } [[nodiscard]] rpl::producer showLReadToggleInDrawerValue() const { return _showLReadToggleInDrawer.value(); } [[nodiscard]] rpl::producer showLReadToggleInDrawerChanges() const { return _showLReadToggleInDrawer.changes(); } [[nodiscard]] rpl::producer showSReadToggleInDrawerValue() const { return _showSReadToggleInDrawer.value(); } [[nodiscard]] rpl::producer showSReadToggleInDrawerChanges() const { return _showSReadToggleInDrawer.changes(); } [[nodiscard]] rpl::producer showNightModeToggleInDrawerValue() const { return _showNightModeToggleInDrawer.value(); } [[nodiscard]] rpl::producer showNightModeToggleInDrawerChanges() const { return _showNightModeToggleInDrawer.changes(); } [[nodiscard]] rpl::producer showGhostToggleInDrawerValue() const { return _showGhostToggleInDrawer.value(); } [[nodiscard]] rpl::producer showGhostToggleInDrawerChanges() const { return _showGhostToggleInDrawer.changes(); } [[nodiscard]] rpl::producer showStreamerToggleInDrawerValue() const { return _showStreamerToggleInDrawer.value(); } [[nodiscard]] rpl::producer showStreamerToggleInDrawerChanges() const { return _showStreamerToggleInDrawer.changes(); } [[nodiscard]] rpl::producer showGhostToggleInTrayValue() const { return _showGhostToggleInTray.value(); } [[nodiscard]] rpl::producer showGhostToggleInTrayChanges() const { return _showGhostToggleInTray.changes(); } [[nodiscard]] rpl::producer showStreamerToggleInTrayValue() const { return _showStreamerToggleInTray.value(); } [[nodiscard]] rpl::producer showStreamerToggleInTrayChanges() const { return _showStreamerToggleInTray.changes(); } [[nodiscard]] rpl::producer monoFontValue() const { return _monoFont.value(); } [[nodiscard]] rpl::producer monoFontChanges() const { return _monoFont.changes(); } [[nodiscard]] rpl::producer hideNotificationCountersValue() const { return _hideNotificationCounters.value(); } [[nodiscard]] rpl::producer hideNotificationCountersChanges() const { return _hideNotificationCounters.changes(); } [[nodiscard]] rpl::producer hideNotificationBadgeValue() const { return _hideNotificationBadge.value(); } [[nodiscard]] rpl::producer hideNotificationBadgeChanges() const { return _hideNotificationBadge.changes(); } [[nodiscard]] rpl::producer hideAllChatsFolderValue() const { return _hideAllChatsFolder.value(); } [[nodiscard]] rpl::producer hideAllChatsFolderChanges() const { return _hideAllChatsFolder.changes(); } [[nodiscard]] rpl::producer channelBottomButtonValue() const { return _channelBottomButton.value(); } [[nodiscard]] rpl::producer channelBottomButtonChanges() const { return _channelBottomButton.changes(); } [[nodiscard]] rpl::producer quickAdminShortcutsValue() const { return _quickAdminShortcuts.value(); } [[nodiscard]] rpl::producer quickAdminShortcutsChanges() const { return _quickAdminShortcuts.changes(); } [[nodiscard]] rpl::producer disableGreetingStickerValue() const { return _disableGreetingSticker.value(); } [[nodiscard]] rpl::producer disableGreetingStickerChanges() const { return _disableGreetingSticker.changes(); } [[nodiscard]] rpl::producer showPeerIdValue() const { return _showPeerId.value(); } [[nodiscard]] rpl::producer showPeerIdChanges() const { return _showPeerId.changes(); } [[nodiscard]] rpl::producer showMessageSecondsValue() const { return _showMessageSeconds.value(); } [[nodiscard]] rpl::producer showMessageSecondsChanges() const { return _showMessageSeconds.changes(); } [[nodiscard]] rpl::producer showMessageShotValue() const { return _showMessageShot.value(); } [[nodiscard]] rpl::producer showMessageShotChanges() const { return _showMessageShot.changes(); } [[nodiscard]] rpl::producer filterZalgoValue() const { return _filterZalgo.value(); } [[nodiscard]] rpl::producer filterZalgoChanges() const { return _filterZalgo.changes(); } [[nodiscard]] rpl::producer stickerConfirmationValue() const { return _stickerConfirmation.value(); } [[nodiscard]] rpl::producer stickerConfirmationChanges() const { return _stickerConfirmation.changes(); } [[nodiscard]] rpl::producer gifConfirmationValue() const { return _gifConfirmation.value(); } [[nodiscard]] rpl::producer gifConfirmationChanges() const { return _gifConfirmation.changes(); } [[nodiscard]] rpl::producer voiceConfirmationValue() const { return _voiceConfirmation.value(); } [[nodiscard]] rpl::producer voiceConfirmationChanges() const { return _voiceConfirmation.changes(); } [[nodiscard]] rpl::producer translationProviderValue() const { return _translationProvider.value(); } [[nodiscard]] rpl::producer translationProviderChanges() const { return _translationProvider.changes(); } [[nodiscard]] rpl::producer adaptiveCoverColorValue() const { return _adaptiveCoverColor.value(); } [[nodiscard]] rpl::producer adaptiveCoverColorChanges() const { return _adaptiveCoverColor.changes(); } [[nodiscard]] rpl::producer improveLinkPreviewsValue() const { return _improveLinkPreviews.value(); } [[nodiscard]] rpl::producer improveLinkPreviewsChanges() const { return _improveLinkPreviews.changes(); } [[nodiscard]] rpl::producer crashReportingValue() const { return _crashReporting.value(); } [[nodiscard]] rpl::producer crashReportingChanges() const { return _crashReporting.changes(); } [[nodiscard]] rpl::producer avatarCornersValue() const { return _avatarCorners.value(); } [[nodiscard]] rpl::producer avatarCornersChanges() const { return _avatarCorners.changes(); } [[nodiscard]] rpl::producer singleCornerRadiusValue() const { return _singleCornerRadius.value(); } [[nodiscard]] rpl::producer singleCornerRadiusChanges() const { return _singleCornerRadius.changes(); } friend void to_json(nlohmann::json &j, const AyuSettings &s); friend void from_json(const nlohmann::json &j, AyuSettings &s); private: AyuSettings(); [[nodiscard]] uint64 getOverriddenGhostUserId(uint64 userId) const { return _useGlobalGhostMode.current() ? 0 : userId; } rpl::variable _saveDeletedMessages = true; rpl::variable _saveMessagesHistory = true; rpl::variable _saveForBots = false; std::unordered_set _shadowBanIds; rpl::variable _filtersEnabled = false; rpl::variable _filtersEnabledInChats = false; rpl::variable _hideFromBlocked = false; rpl::variable _semiTransparentDeletedMessages = false; rpl::variable _disableAds = true; rpl::variable _disableStories = false; rpl::variable _disableCustomBackgrounds = false; rpl::variable _showOnlyAddedEmojisAndStickers = false; rpl::variable _collapseSimilarChannels = true; rpl::variable _hideSimilarChannels = false; rpl::variable _messageBubbleRadius = 16; rpl::variable _disableOpenLinkWarning = false; rpl::variable _wideMultiplier = 1.0; rpl::variable _spoofWebviewAsAndroid = false; rpl::variable _increaseWebviewHeight = false; rpl::variable _increaseWebviewWidth = false; rpl::variable _materialSwitches = true; rpl::variable _removeMessageTail = false; rpl::variable _disableNotificationsDelay = false; rpl::variable _localPremium = false; rpl::variable _showChannelReactions = true; rpl::variable _showGroupReactions = true; rpl::variable _showPrivateChatReactions = true; rpl::variable _appIcon; rpl::variable _simpleQuotesAndReplies = false; rpl::variable _hideFastShare = false; rpl::variable _replaceBottomInfoWithIcons = true; rpl::variable _deletedMark = QString::fromUtf8("🧹"); rpl::variable _editedMark; rpl::variable _recentStickersCount = 100; rpl::variable _showReactionsPanelInContextMenu = ContextMenuVisibility::Visible; rpl::variable _showViewsPanelInContextMenu = ContextMenuVisibility::Visible; rpl::variable _showHideMessageInContextMenu = ContextMenuVisibility::Hidden; rpl::variable _showUserMessagesInContextMenu = ContextMenuVisibility::VisibleWithModifier; rpl::variable _showMessageDetailsInContextMenu = ContextMenuVisibility::VisibleWithModifier; rpl::variable _showRepeatMessageInContextMenu = ContextMenuVisibility::Hidden; rpl::variable _showAddFilterInContextMenu = ContextMenuVisibility::Visible; rpl::variable _showAttachButtonInMessageField = true; rpl::variable _showCommandsButtonInMessageField = true; rpl::variable _showEmojiButtonInMessageField = true; rpl::variable _showMicrophoneButtonInMessageField = true; rpl::variable _showAutoDeleteButtonInMessageField = true; rpl::variable _showGiftButtonInMessageField = true; rpl::variable _showAiEditorButtonInMessageField = true; rpl::variable _showAttachPopup = true; rpl::variable _showEmojiPopup = true; rpl::variable _showMyProfileInDrawer = true; rpl::variable _showBotsInDrawer = true; rpl::variable _showNewGroupInDrawer = true; rpl::variable _showNewChannelInDrawer = true; rpl::variable _showContactsInDrawer = true; rpl::variable _showCallsInDrawer = true; rpl::variable _showSavedMessagesInDrawer = true; rpl::variable _showLReadToggleInDrawer = false; rpl::variable _showSReadToggleInDrawer = true; rpl::variable _showNightModeToggleInDrawer = true; rpl::variable _showGhostToggleInDrawer = true; rpl::variable _showStreamerToggleInDrawer = false; rpl::variable _showGhostToggleInTray = true; rpl::variable _showStreamerToggleInTray = false; rpl::variable _hidePremiumStatuses = false; rpl::variable _monoFont; rpl::variable _hideNotificationCounters = false; rpl::variable _hideNotificationBadge = false; rpl::variable _hideAllChatsFolder = false; rpl::variable _channelBottomButton = ChannelBottomButton::DiscussWithFallback; rpl::variable _quickAdminShortcuts = true; rpl::variable _disableGreetingSticker = false; rpl::variable _showPeerId = PeerIdDisplay::BotApi; rpl::variable _showMessageSeconds = false; rpl::variable _showMessageShot = true; rpl::variable _filterZalgo = false; rpl::variable _stickerConfirmation = false; rpl::variable _gifConfirmation = false; rpl::variable _voiceConfirmation = false; rpl::variable _translationProvider = TranslationProvider::Telegram; rpl::variable _adaptiveCoverColor = true; rpl::variable _improveLinkPreviews = false; rpl::variable _crashReporting = true; rpl::variable _avatarCorners = 23; rpl::variable _singleCornerRadius = false; rpl::variable _useGlobalGhostMode = true; std::map> _ghostAccounts; MessageShotSettings _messageShotSettings; }; void to_json(nlohmann::json &j, const AyuSettings &s); void from_json(const nlohmann::json &j, AyuSettings &s);