mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
feat: don't read stories
feat: show message ID in tooltip feat: update strings fix: invert strings
This commit is contained in:
parent
486e6e681c
commit
576671e222
14 changed files with 174 additions and 101 deletions
|
@ -3948,31 +3948,35 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
"ayu_AyuPreferences" = "AyuGram Preferences";
|
||||
"ayu_GhostEssentialsHeader" = "Ghost essentials";
|
||||
"ayu_SendReadPackets" = "Send read status";
|
||||
"ayu_SendOnlinePackets" = "Send online status";
|
||||
"ayu_SendUploadProgress" = "Send typing & upload status";
|
||||
"ayu_DontReadMessages" = "Don't read messages";
|
||||
"ayu_DontReadStories" = "Don't read stories";
|
||||
"ayu_DontSendOnlinePackets" = "Don't send online";
|
||||
"ayu_DontSendUploadProgress" = "Don't send typing";
|
||||
"ayu_SendOfflinePacketAfterOnline" = "Immediate offline after online";
|
||||
"ayu_MarkReadAfterSend" = "Send read status after reply";
|
||||
"ayu_UseScheduledMessages" = "Schedule messages";
|
||||
"ayu_SpyEssentialsHeader" = "Spy essentials";
|
||||
"ayu_SaveDeletedMessages" = "Save deleted messages";
|
||||
"ayu_SaveMessagesHistory" = "Save edits history";
|
||||
"ayu_MessageSavingBtn" = "Message saving Preferences";
|
||||
"ayu_MessageSavingBtn" = "Message Saving Preferences";
|
||||
"ayu_MessageSavingMediaHeader" = "Media";
|
||||
"ayu_MessageSavingSaveMedia" = "Save media";
|
||||
"ayu_MessageSavingSaveMediaInPrivateChats" = "…in private chats";
|
||||
"ayu_MessageSavingSaveMediaInPublicChannels" = "…in public channels";
|
||||
"ayu_MessageSavingSaveMediaInPrivateChannels" = "…in private channels";
|
||||
"ayu_MessageSavingSaveMediaInPublicGroups" = "…in public groups";
|
||||
"ayu_MessageSavingSaveMediaInPrivateGroups" = "…in private groups";
|
||||
"ayu_MessageSavingSaveMediaHint" = "Click for more";
|
||||
"ayu_MessageSavingSaveMediaInPrivateChats" = "…in private chats";
|
||||
"ayu_MessageSavingSaveMediaInPublicChannels" = "…in public channels";
|
||||
"ayu_MessageSavingSaveMediaInPrivateChannels" = "…in private channels";
|
||||
"ayu_MessageSavingSaveMediaInPublicGroups" = "…in public groups";
|
||||
"ayu_MessageSavingSaveMediaInPrivateGroups" = "…in private groups";
|
||||
"ayu_MessageSavingOtherHeader" = "Other";
|
||||
"ayu_MessageSavingSaveFormatting" = "Save formatting";
|
||||
"ayu_MessageSavingSaveReactions" = "Save reactions";
|
||||
"ayu_MessageSavingSaveForBots" = "Save in bot dialogs";
|
||||
"ayu_QoLTogglesHeader" = "Useful features";
|
||||
"ayu_ShowFromChannel" = "Show «channel» label";
|
||||
"ayu_KeepAliveService" = "Keep Alive Service";
|
||||
"ayu_EnableAds" = "Enable ads";
|
||||
"ayu_KeepAliveService" = "AyuGram Push Service";
|
||||
"ayu_DisableStories" = "Disable stories";
|
||||
"ayu_DisableAds" = "Disable ads";
|
||||
"ayu_LocalPremium" = "Local Telegram Premium";
|
||||
"ayu_CopyUsernameAsLink" = "Copy username as link";
|
||||
"ayu_CustomizationHeader" = "Customization";
|
||||
"ayu_DeletedMarkText" = "Deleted mark";
|
||||
"ayu_EditedMarkText" = "Edited mark";
|
||||
|
@ -3982,14 +3986,14 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
"ayu_SettingsShowID_Hide" = "Hide";
|
||||
"ayu_SettingsRecentStickersCount" = "Recent stickers count";
|
||||
"ayu_SettingsCustomizationHint" = "After making changes to the \"Customization\" section, you must restart the application.";
|
||||
"ayu_RegexFilters" = "Message filters";
|
||||
"ayu_RegexFiltersSubText" = "filters";
|
||||
"ayu_RegexFilters" = "Message Filters";
|
||||
"ayu_RegexFiltersAmount" = "filters";
|
||||
"ayu_RegexFiltersHeader" = "Filters";
|
||||
"ayu_RegexFiltersEnableInChats" = "Enable in chats";
|
||||
"ayu_RegexFiltersCaseInsensitive" = "Case insensitive expressions";
|
||||
"ayu_RegexFiltersAdd" = "Add filter";
|
||||
"ayu_RegexFiltersEdit" = "Edit filter";
|
||||
"ayu_RegexFiltersAddDescription_Android" = "You can use site <![CDATA[<a href=\"https://regex101.com\">regex101.com</a>]]> to fully test your regular expression.\nYou can also use plain text, but don't forget to escape brackets.";
|
||||
"ayu_RegexFiltersPlaceholder" = "Expression";
|
||||
"ayu_RegexFiltersAddError" = "Regex syntax error";
|
||||
"ayu_AyuSyncHeader" = "AyuSync";
|
||||
"ayu_AyuSyncStatusTitle" = "Sync status";
|
||||
|
@ -3999,12 +4003,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
"ayu_AyuSyncStatusErrorNoToken" = "no token";
|
||||
"ayu_AyuSyncStatusErrorInvalidToken" = "invalid token";
|
||||
"ayu_AyuSyncStatusErrorNoMVP" = "no MVP";
|
||||
"ayu_AyuSyncServerURL" = "AyuSync URL";
|
||||
"ayu_AyuSyncServerToken" = "AyuSync token";
|
||||
"ayu_AyuSyncServerURL" = "Server URL";
|
||||
"ayu_AyuSyncServerToken" = "Access token";
|
||||
"ayu_AyuSyncEnable" = "Enable synchronization";
|
||||
"ayu_AyuSyncVisitProfile" = "Visit profile";
|
||||
"ayu_AyuSyncForceSync" = "Force sync clients";
|
||||
"ayu_AyuSyncDeviceIdentifier" = "Device identifier";
|
||||
"ayu_AyuSyncDeviceIdentifier" = "Device ID";
|
||||
"ayu_AyuSyncLastEventSent" = "Last sent event";
|
||||
"ayu_AyuSyncLastEventReceived" = "Last received event";
|
||||
"ayu_AyuSyncLastEventNever" = "never";
|
||||
|
@ -4014,30 +4018,37 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
"ayu_AyuSyncOpenPreferences" = "Open preferences";
|
||||
"ayu_AyuSyncDownloadAgent" = "Download agent";
|
||||
"ayu_WALMode" = "Enable WAL mode";
|
||||
"ayu_CleanDatabase" = "Clean database";
|
||||
"ayu_CleanDatabaseNotification" = "AyuGram database cleaned";
|
||||
"ayu_BetaFeatures" = "Beta features";
|
||||
"ayu_ClearAyuDatabase" = "Clear Ayu Database";
|
||||
"ayu_ClearAyuDatabaseNotification" = "AyuGram database cleared";
|
||||
"ayu_EraseLocalDatabase" = "Erase Local Database";
|
||||
"ayu_ConfirmationsTitle" = "Confirmations";
|
||||
"ayu_StickerConfirmation" = "Confirmation when sending stickers";
|
||||
"ayu_GIFConfirmation" = "Confirmation when sending GIFs";
|
||||
"ayu_VoiceConfirmation" = "Confirmation when sending voice messages";
|
||||
"ayu_EnableGhostMode" = "Enable Ghost";
|
||||
"ayu_DisableGhostMode" = "Disable Ghost";
|
||||
"ayu_KillApp" = "Kill App";
|
||||
"ayu_DrawerGhostModeToggle" = "Ghost Mode";
|
||||
"ayu_LReadMessages" = "Read on Local";
|
||||
"ayu_SReadMessages" = "Read on Server";
|
||||
"ayu_GhostModeToggle" = "Ghost Mode";
|
||||
"ayu_GhostModeEnabled" = "Ghost mode turned on";
|
||||
"ayu_GhostModeDisabled" = "Ghost mode turned off";
|
||||
"ayu_EditsHistoryTitle" = "Edits history";
|
||||
"ayu_EditsHistoryMenuText" = "History";
|
||||
"ayu_ReadUntilMenuText" = "Read until";
|
||||
"ayu_DeleteKeepLocally" = "Keep locally";
|
||||
"ayu_BoxActionReset" = "Reset";
|
||||
"ayu_ReadConfirmationBoxQuestion" = "Do you want to read all messages?";
|
||||
"ayu_ReadConfirmationBoxActionText" = "Read";
|
||||
"ayu_ForwardsRestrictedInfoDeleted" = "Forwarding of a deleted message is not supported.";
|
||||
"ayu_AyuForwardStatusForwarding" = "Forwarding messages…";
|
||||
"ayu_AyuForwardStatusLoadingMedia" = "Loading media…";
|
||||
"ayu_AyuForwardForwardingDescription" = "Please keep this window open while AyuGram is forwarding your messages.";
|
||||
"ayu_AyuForwardLoadingMediaDescription" = "Please keep this window open while AyuGram is downloading media from your messages.";
|
||||
"ayu_DeleteDateMenuText" = "Delete Date";
|
||||
"ayu_LikelyOfflineStatus" = "offline ?";
|
||||
"ayu_GhostModeShortcut" = "Enter with Ghost";
|
||||
"ayu_SettingsWatermark" = "AyuGram developed and maintained by Radolyn Labs.";
|
||||
"ayu_SettingsShowMessageSeconds" = "Show message seconds";
|
||||
"ayu_ContextCopyID" = "Copy ID";
|
||||
"ayu_IDCopiedToast" = "ID copied to clipboard.";
|
||||
"ayu_ContextHideMessage" = "Hide";
|
||||
"ayu_SettingsWatermark" = "AyuGram developed and maintained by Radolyn Labs.";
|
||||
|
|
|
@ -17,7 +17,8 @@ namespace AyuSettings
|
|||
const QString filename = "tdata/ayu_settings.json";
|
||||
std::optional<AyuGramSettings> settings = std::nullopt;
|
||||
|
||||
rpl::variable<bool> sendReadPacketsReactive;
|
||||
rpl::variable<bool> sendReadMessagesReactive;
|
||||
rpl::variable<bool> sendReadStoriesReactive;
|
||||
rpl::variable<bool> sendOnlinePacketsReactive;
|
||||
rpl::variable<bool> sendUploadProgressReactive;
|
||||
rpl::variable<bool> sendOfflinePacketAfterOnlineReactive;
|
||||
|
@ -32,10 +33,12 @@ namespace AyuSettings
|
|||
|
||||
bool ghostModeEnabled_util(AyuGramSettings& settingsUtil)
|
||||
{
|
||||
return (!settingsUtil.sendReadPackets
|
||||
return
|
||||
!settingsUtil.sendReadMessages
|
||||
&& !settingsUtil.sendReadStories
|
||||
&& !settingsUtil.sendOnlinePackets
|
||||
&& !settingsUtil.sendUploadProgress
|
||||
&& settingsUtil.sendOfflinePacketAfterOnline);
|
||||
&& settingsUtil.sendOfflinePacketAfterOnline;
|
||||
}
|
||||
|
||||
void initialize()
|
||||
|
@ -47,13 +50,22 @@ namespace AyuSettings
|
|||
|
||||
settings = AyuGramSettings();
|
||||
|
||||
sendReadPacketsReactive.value() | rpl::filter([=](bool val)
|
||||
sendReadMessagesReactive.value() | rpl::filter([=](bool val)
|
||||
{
|
||||
return (val != settings->sendReadPackets);
|
||||
return (val != settings->sendReadMessages);
|
||||
}) | start_with_next([=](bool val)
|
||||
{
|
||||
ghostModeEnabled = ghostModeEnabled_util(settings.value());
|
||||
}, lifetime);
|
||||
// ..
|
||||
sendReadStoriesReactive.value() | rpl::filter([=](bool val)
|
||||
{
|
||||
return (val != settings->sendReadStories);
|
||||
}) | start_with_next([=](bool val)
|
||||
{
|
||||
ghostModeEnabled = ghostModeEnabled_util(settings.value());
|
||||
}, lifetime);
|
||||
// ..
|
||||
sendOnlinePacketsReactive.value() | rpl::filter([=](bool val)
|
||||
{
|
||||
return (val != settings->sendOnlinePackets);
|
||||
|
@ -61,6 +73,7 @@ namespace AyuSettings
|
|||
{
|
||||
ghostModeEnabled = ghostModeEnabled_util(settings.value());
|
||||
}, lifetime);
|
||||
// ..
|
||||
sendUploadProgressReactive.value() | rpl::filter([=](bool val)
|
||||
{
|
||||
return (val != settings->sendUploadProgress);
|
||||
|
@ -68,6 +81,7 @@ namespace AyuSettings
|
|||
{
|
||||
ghostModeEnabled = ghostModeEnabled_util(settings.value());
|
||||
}, lifetime);
|
||||
// ..
|
||||
sendOfflinePacketAfterOnlineReactive.value() | rpl::filter([=](bool val)
|
||||
{
|
||||
return (val != settings->sendOfflinePacketAfterOnline);
|
||||
|
@ -79,7 +93,7 @@ namespace AyuSettings
|
|||
|
||||
void postinitialize()
|
||||
{
|
||||
sendReadPacketsReactive = settings->sendReadPackets;
|
||||
sendReadMessagesReactive = settings->sendReadMessages;
|
||||
sendOnlinePacketsReactive = settings->sendOnlinePackets;
|
||||
|
||||
deletedMarkReactive = settings->deletedMark;
|
||||
|
@ -133,10 +147,16 @@ namespace AyuSettings
|
|||
postinitialize();
|
||||
}
|
||||
|
||||
void AyuGramSettings::set_sendReadPackets(bool val)
|
||||
void AyuGramSettings::set_sendReadMessages(bool val)
|
||||
{
|
||||
sendReadPackets = val;
|
||||
sendReadPacketsReactive = val;
|
||||
sendReadMessages = val;
|
||||
sendReadMessagesReactive = val;
|
||||
}
|
||||
|
||||
void AyuGramSettings::set_sendReadStories(bool val)
|
||||
{
|
||||
sendReadStories = val;
|
||||
sendReadStoriesReactive = val;
|
||||
}
|
||||
|
||||
void AyuGramSettings::set_sendOnlinePackets(bool val)
|
||||
|
@ -157,6 +177,15 @@ namespace AyuSettings
|
|||
sendOfflinePacketAfterOnlineReactive = val;
|
||||
}
|
||||
|
||||
void AyuGramSettings::set_ghostModeEnabled(bool val)
|
||||
{
|
||||
set_sendReadMessages(!val);
|
||||
set_sendReadStories(!val);
|
||||
set_sendOnlinePackets(!val);
|
||||
set_sendUploadProgress(!val);
|
||||
set_sendOfflinePacketAfterOnline(val);
|
||||
}
|
||||
|
||||
void AyuGramSettings::set_markReadAfterSend(bool val)
|
||||
{
|
||||
markReadAfterSend = val;
|
||||
|
@ -220,9 +249,9 @@ namespace AyuSettings
|
|||
stickerConfirmation = val;
|
||||
}
|
||||
|
||||
void AyuGramSettings::set_GIFConfirmation(bool val)
|
||||
void AyuGramSettings::set_gifConfirmation(bool val)
|
||||
{
|
||||
GIFConfirmation = val;
|
||||
gifConfirmation = val;
|
||||
}
|
||||
|
||||
void AyuGramSettings::set_voiceConfirmation(bool val)
|
||||
|
|
|
@ -20,13 +20,13 @@ namespace AyuSettings
|
|||
AyuGramSettings()
|
||||
{
|
||||
// ~ Ghost essentials
|
||||
sendReadPackets = true;
|
||||
sendReadMessages = true;
|
||||
sendReadStories = true;
|
||||
sendOnlinePackets = true;
|
||||
sendUploadProgress = true;
|
||||
|
||||
sendOfflinePacketAfterOnline = false;
|
||||
markReadAfterSend = true;
|
||||
|
||||
markReadAfterSend = true;
|
||||
useScheduledMessages = false;
|
||||
|
||||
// ~ Message edits & deletion history
|
||||
|
@ -35,6 +35,7 @@ namespace AyuSettings
|
|||
|
||||
// ~ QoL toggles
|
||||
enableAds = false;
|
||||
disableStories = false;
|
||||
copyUsernameAsLink = true;
|
||||
|
||||
// ~ Customization
|
||||
|
@ -52,13 +53,14 @@ namespace AyuSettings
|
|||
|
||||
showMessageSeconds = false;
|
||||
|
||||
// ~ Beta functionality
|
||||
// ~ Confirmations
|
||||
stickerConfirmation = false;
|
||||
GIFConfirmation = false;
|
||||
gifConfirmation = false;
|
||||
voiceConfirmation = false;
|
||||
}
|
||||
|
||||
bool sendReadPackets;
|
||||
bool sendReadMessages;
|
||||
bool sendReadStories;
|
||||
bool sendOnlinePackets;
|
||||
bool sendUploadProgress;
|
||||
bool sendOfflinePacketAfterOnline;
|
||||
|
@ -67,6 +69,8 @@ namespace AyuSettings
|
|||
bool saveDeletedMessages;
|
||||
bool saveMessagesHistory;
|
||||
bool enableAds;
|
||||
bool disableStories;
|
||||
bool copyUsernameAsLink;
|
||||
QString deletedMark;
|
||||
QString editedMark;
|
||||
int recentStickersCount;
|
||||
|
@ -74,12 +78,13 @@ namespace AyuSettings
|
|||
int showPeerId;
|
||||
bool showMessageSeconds;
|
||||
bool stickerConfirmation;
|
||||
bool GIFConfirmation;
|
||||
bool gifConfirmation;
|
||||
bool voiceConfirmation;
|
||||
bool copyUsernameAsLink;
|
||||
|
||||
public:
|
||||
void set_sendReadPackets(bool val);
|
||||
void set_sendReadMessages(bool val);
|
||||
|
||||
void set_sendReadStories(bool val);
|
||||
|
||||
void set_sendOnlinePackets(bool val);
|
||||
|
||||
|
@ -87,6 +92,8 @@ namespace AyuSettings
|
|||
|
||||
void set_sendOfflinePacketAfterOnline(bool val);
|
||||
|
||||
void set_ghostModeEnabled(bool val);
|
||||
|
||||
void set_markReadAfterSend(bool val);
|
||||
|
||||
void set_useScheduledMessages(bool val);
|
||||
|
@ -111,7 +118,7 @@ namespace AyuSettings
|
|||
|
||||
void set_stickerConfirmation(bool val);
|
||||
|
||||
void set_GIFConfirmation(bool val);
|
||||
void set_gifConfirmation(bool val);
|
||||
|
||||
void set_voiceConfirmation(bool val);
|
||||
|
||||
|
@ -120,7 +127,8 @@ namespace AyuSettings
|
|||
|
||||
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(
|
||||
AyuGramSettings,
|
||||
sendReadPackets,
|
||||
sendReadMessages,
|
||||
sendReadStories,
|
||||
sendOnlinePackets,
|
||||
sendUploadProgress,
|
||||
sendOfflinePacketAfterOnline,
|
||||
|
@ -136,7 +144,7 @@ namespace AyuSettings
|
|||
showPeerId,
|
||||
showMessageSeconds,
|
||||
stickerConfirmation,
|
||||
GIFConfirmation,
|
||||
gifConfirmation,
|
||||
voiceConfirmation,
|
||||
copyUsernameAsLink
|
||||
);
|
||||
|
|
|
@ -18,6 +18,6 @@ namespace AyuState
|
|||
bool getAllowSendPacket()
|
||||
{
|
||||
auto settings = &AyuSettings::getInstance();
|
||||
return settings->sendReadPackets || processVariable(allowSendReadPacket);
|
||||
return settings->sendReadMessages || processVariable(allowSendReadPacket);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,12 +53,12 @@ namespace AyuUi
|
|||
void ConfirmationBox::ReadAllPeers()
|
||||
{
|
||||
auto settings = &AyuSettings::getInstance();
|
||||
auto prev = settings->sendReadPackets;
|
||||
settings->set_sendReadPackets(true);
|
||||
auto prev = settings->sendReadMessages;
|
||||
settings->set_sendReadMessages(true);
|
||||
|
||||
auto chats = _controller->session().data().chatsList();
|
||||
Window::MarkAsReadChatListHack(chats);
|
||||
|
||||
settings->set_sendReadPackets(prev);
|
||||
settings->set_sendReadMessages(prev);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,49 +56,65 @@ namespace Settings
|
|||
|
||||
AddButton(
|
||||
container,
|
||||
tr::ayu_SendReadPackets(),
|
||||
tr::ayu_DontReadMessages(),
|
||||
st::settingsButtonNoIcon
|
||||
)->toggleOn(
|
||||
rpl::single(settings->sendReadPackets)
|
||||
rpl::single(!settings->sendReadMessages)
|
||||
)->toggledValue(
|
||||
) | rpl::filter([=](bool enabled)
|
||||
{
|
||||
return (enabled != settings->sendReadPackets);
|
||||
return (enabled == settings->sendReadMessages);
|
||||
}) | start_with_next([=](bool enabled)
|
||||
{
|
||||
settings->set_sendReadPackets(enabled);
|
||||
settings->set_sendReadMessages(!enabled);
|
||||
AyuSettings::save();
|
||||
}, container->lifetime());
|
||||
|
||||
AddButton(
|
||||
container,
|
||||
tr::ayu_SendOnlinePackets(),
|
||||
tr::ayu_DontReadStories(),
|
||||
st::settingsButtonNoIcon
|
||||
)->toggleOn(
|
||||
rpl::single(settings->sendOnlinePackets)
|
||||
rpl::single(!settings->sendReadStories)
|
||||
)->toggledValue(
|
||||
) | rpl::filter([=](bool enabled)
|
||||
{
|
||||
return (enabled != settings->sendOnlinePackets);
|
||||
return (enabled == settings->sendReadStories);
|
||||
}) | start_with_next([=](bool enabled)
|
||||
{
|
||||
settings->set_sendOnlinePackets(enabled);
|
||||
settings->set_sendReadStories(!enabled);
|
||||
AyuSettings::save();
|
||||
}, container->lifetime());
|
||||
|
||||
AddButton(
|
||||
container,
|
||||
tr::ayu_SendUploadProgress(),
|
||||
tr::ayu_DontSendOnlinePackets(),
|
||||
st::settingsButtonNoIcon
|
||||
)->toggleOn(
|
||||
rpl::single(settings->sendUploadProgress)
|
||||
rpl::single(!settings->sendOnlinePackets)
|
||||
)->toggledValue(
|
||||
) | rpl::filter([=](bool enabled)
|
||||
{
|
||||
return (enabled != settings->sendUploadProgress);
|
||||
return (enabled == settings->sendOnlinePackets);
|
||||
}) | start_with_next([=](bool enabled)
|
||||
{
|
||||
settings->set_sendUploadProgress(enabled);
|
||||
settings->set_sendOnlinePackets(!enabled);
|
||||
AyuSettings::save();
|
||||
}, container->lifetime());
|
||||
|
||||
AddButton(
|
||||
container,
|
||||
tr::ayu_DontSendUploadProgress(),
|
||||
st::settingsButtonNoIcon
|
||||
)->toggleOn(
|
||||
rpl::single(!settings->sendUploadProgress)
|
||||
)->toggledValue(
|
||||
) | rpl::filter([=](bool enabled)
|
||||
{
|
||||
return (enabled == settings->sendUploadProgress);
|
||||
}) | start_with_next([=](bool enabled)
|
||||
{
|
||||
settings->set_sendUploadProgress(!enabled);
|
||||
AyuSettings::save();
|
||||
}, container->lifetime());
|
||||
|
||||
|
@ -198,23 +214,23 @@ namespace Settings
|
|||
|
||||
AddButton(
|
||||
container,
|
||||
tr::ayu_EnableAds(),
|
||||
tr::ayu_DisableAds(),
|
||||
st::settingsButtonNoIcon
|
||||
)->toggleOn(
|
||||
rpl::single(settings->enableAds)
|
||||
rpl::single(!settings->enableAds)
|
||||
)->toggledValue(
|
||||
) | rpl::filter([=](bool enabled)
|
||||
{
|
||||
return (enabled != settings->enableAds);
|
||||
return (enabled == settings->enableAds);
|
||||
}) | start_with_next([=](bool enabled)
|
||||
{
|
||||
settings->set_enableAds(enabled);
|
||||
settings->set_enableAds(!enabled);
|
||||
AyuSettings::save();
|
||||
}, container->lifetime());
|
||||
|
||||
|
||||
AddButton(
|
||||
container,
|
||||
rpl::single(QString("Copy username as link")),
|
||||
tr::ayu_CopyUsernameAsLink(),
|
||||
st::settingsButtonNoIcon
|
||||
)->toggleOn(
|
||||
rpl::single(settings->copyUsernameAsLink)
|
||||
|
@ -403,7 +419,7 @@ namespace Settings
|
|||
{
|
||||
auto settings = &AyuSettings::getInstance();
|
||||
|
||||
AddSubsectionTitle(container, tr::ayu_BetaFeatures());
|
||||
AddSubsectionTitle(container, tr::ayu_ConfirmationsTitle());
|
||||
|
||||
AddButton(
|
||||
container,
|
||||
|
@ -426,14 +442,14 @@ namespace Settings
|
|||
tr::ayu_GIFConfirmation(),
|
||||
st::settingsButtonNoIcon
|
||||
)->toggleOn(
|
||||
rpl::single(settings->GIFConfirmation)
|
||||
rpl::single(settings->gifConfirmation)
|
||||
)->toggledValue(
|
||||
) | rpl::filter([=](bool enabled)
|
||||
{
|
||||
return (enabled != settings->GIFConfirmation);
|
||||
return (enabled != settings->gifConfirmation);
|
||||
}) | start_with_next([=](bool enabled)
|
||||
{
|
||||
settings->set_GIFConfirmation(enabled);
|
||||
settings->set_gifConfirmation(enabled);
|
||||
AyuSettings::save();
|
||||
}, container->lifetime());
|
||||
|
||||
|
@ -482,7 +498,7 @@ namespace Settings
|
|||
|
||||
AddSkip(container);
|
||||
SetupSendConfirmations(container);
|
||||
|
||||
|
||||
AddDividerText(container, tr::ayu_SettingsWatermark());
|
||||
}
|
||||
|
||||
|
|
|
@ -499,7 +499,7 @@ void GifsListWidget::selectInlineResult(
|
|||
});
|
||||
};
|
||||
|
||||
if (settings->GIFConfirmation)
|
||||
if (settings->gifConfirmation)
|
||||
{
|
||||
Ui::show(Ui::MakeConfirmBox({
|
||||
.text = rpl::single(QString("Do you want to send this GIF?")),
|
||||
|
|
|
@ -204,9 +204,9 @@ void Histories::readInboxTill(
|
|||
|
||||
AyuSync::getInstance().syncRead(history, tillId);
|
||||
|
||||
// AyuGram sendReadPackets
|
||||
// AyuGram sendReadMessages
|
||||
const auto settings = &AyuSettings::getInstance();
|
||||
auto allow = settings->sendReadPackets;
|
||||
auto allow = settings->sendReadMessages;
|
||||
auto reallyAllow = AyuState::getAllowSendPacket(); // will return true if `allow`
|
||||
if (!reallyAllow)
|
||||
{
|
||||
|
|
|
@ -24,6 +24,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/layers/show.h"
|
||||
#include "ui/text/text_utilities.h"
|
||||
|
||||
// AyuGram includes
|
||||
#include "ayu/ayu_settings.h"
|
||||
|
||||
|
||||
namespace Data {
|
||||
namespace {
|
||||
|
||||
|
@ -1127,11 +1131,21 @@ void Stories::sendMarkAsReadRequest(
|
|||
checkQuitPreventFinished();
|
||||
};
|
||||
|
||||
const auto api = &_owner->session().api();
|
||||
api->request(MTPstories_ReadStories(
|
||||
peer->asUser()->inputUser,
|
||||
MTP_int(tillId)
|
||||
)).done(finish).fail(finish).send();
|
||||
// AyuGram sendReadStories
|
||||
const auto settings = &AyuSettings::getInstance();
|
||||
|
||||
if (settings->sendReadStories)
|
||||
{
|
||||
const auto api = &_owner->session().api();
|
||||
api->request(MTPstories_ReadStories(
|
||||
peer->asUser()->inputUser,
|
||||
MTP_int(tillId)
|
||||
)).done(finish).fail(finish).send();
|
||||
}
|
||||
else
|
||||
{
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
void Stories::checkQuitPreventFinished() {
|
||||
|
|
|
@ -3892,7 +3892,7 @@ void HistoryWidget::send(Api::SendOptions options) {
|
|||
options.scheduled = current + 12;
|
||||
}
|
||||
|
||||
if (!settings->sendReadPackets && settings->markReadAfterSend)
|
||||
if (!settings->sendReadMessages && settings->markReadAfterSend)
|
||||
{
|
||||
AyuState::setAllowSendReadPacket(true);
|
||||
_history->session().data().histories().readInboxOnNewMessage(_history->lastMessage());
|
||||
|
|
|
@ -277,6 +277,9 @@ QString DateTooltipText(not_null<Element*> view) {
|
|||
+ tr::lng_signed_author(tr::now, lt_user, msgsigned->author);
|
||||
}
|
||||
}
|
||||
dateText += '\n';
|
||||
dateText += "ID: ";
|
||||
dateText += QString::number(item->id.bare);
|
||||
return dateText;
|
||||
}
|
||||
|
||||
|
|
|
@ -103,13 +103,9 @@ void Tray::rebuildMenu() {
|
|||
_tray.addAction(std::move(turnGhostModeText), [=]
|
||||
{
|
||||
auto settings = &AyuSettings::getInstance();
|
||||
bool ghostMode = !AyuSettings::get_ghostModeEnabled();
|
||||
bool ghostMode = AyuSettings::get_ghostModeEnabled();
|
||||
|
||||
settings->set_sendReadPackets(!ghostMode);
|
||||
settings->set_sendOnlinePackets(!ghostMode);
|
||||
settings->set_sendUploadProgress(!ghostMode);
|
||||
|
||||
settings->set_sendOfflinePacketAfterOnline(ghostMode);
|
||||
settings->set_ghostModeEnabled(!ghostMode);
|
||||
|
||||
AyuSettings::save();
|
||||
});
|
||||
|
|
|
@ -801,21 +801,21 @@ void MainMenu::setupMenu() {
|
|||
controller->showPeerHistory(controller->session().user());
|
||||
});
|
||||
addAction(
|
||||
rpl::single(QString("LRead Messages")),
|
||||
tr::ayu_LReadMessages(),
|
||||
{ &st::menuIconMarkRead }
|
||||
)->setClickedCallback([=]
|
||||
{
|
||||
auto settings = &AyuSettings::getInstance();
|
||||
auto prev = settings->sendReadPackets;
|
||||
settings->set_sendReadPackets(false);
|
||||
auto prev = settings->sendReadMessages;
|
||||
settings->set_sendReadMessages(false);
|
||||
|
||||
auto chats = controller->session().data().chatsList();
|
||||
MarkAsReadChatListHack(chats);
|
||||
|
||||
settings->set_sendReadPackets(prev);
|
||||
settings->set_sendReadMessages(prev);
|
||||
});
|
||||
addAction(
|
||||
rpl::single(QString("SRead Messages")),
|
||||
tr::ayu_SReadMessages(),
|
||||
{ &st::menuIconMarkRead }
|
||||
)->setClickedCallback([=]
|
||||
{
|
||||
|
@ -887,18 +887,14 @@ void MainMenu::setupMenu() {
|
|||
if (settings->showGhostToggleInDrawer)
|
||||
{
|
||||
_ghostModeToggle = addAction(
|
||||
tr::ayu_DrawerGhostModeToggle(),
|
||||
tr::ayu_GhostModeToggle(),
|
||||
{ &st::menuIconSilent } // todo: fix `ayuGhostIcon`
|
||||
)->toggleOn(AyuSettings::get_ghostModeEnabledReactive());
|
||||
|
||||
_ghostModeToggle->toggledChanges(
|
||||
) | rpl::start_with_next([=](bool ghostMode)
|
||||
{
|
||||
settings->set_sendReadPackets(!ghostMode);
|
||||
settings->set_sendOnlinePackets(!ghostMode);
|
||||
settings->set_sendUploadProgress(!ghostMode);
|
||||
|
||||
settings->set_sendOfflinePacketAfterOnline(ghostMode);
|
||||
settings->set_ghostModeEnabled(ghostMode);
|
||||
|
||||
AyuSettings::save();
|
||||
}, _ghostModeToggle->lifetime());
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 9f91b83c4c85b476a83f5da5e2b7986c68f410cf
|
||||
Subproject commit dbc0816644ba1caa533e69fb1cbf6ba5566f1150
|
Loading…
Add table
Reference in a new issue