Skip to content

Commit

Permalink
Updated to 4.9.
Browse files Browse the repository at this point in the history
  • Loading branch information
23rd committed Aug 14, 2023
2 parents 7280a37 + b352537 commit 895cea4
Show file tree
Hide file tree
Showing 283 changed files with 3,900 additions and 1,448 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ include(cmake/validate_special_target.cmake)
include(cmake/version.cmake)
desktop_app_parse_version(Telegram/build/version)

set(project_langs C CXX)
set(project_langs ASM C CXX)
if (APPLE)
set(project_langs C CXX OBJC OBJCXX)
list(APPEND project_langs OBJC OBJCXX)
endif()

project(Telegram
Expand All @@ -43,9 +43,10 @@ endif()
include(cmake/variables.cmake)
include(cmake/nice_target_sources.cmake)
include(cmake/target_compile_options_if_exists.cmake)
include(cmake/target_link_frameworks.cmake)
include(cmake/target_link_optional_libraries.cmake)
include(cmake/target_link_options_if_exists.cmake)
include(cmake/target_link_static_libraries.cmake)
include(cmake/target_link_frameworks.cmake)
include(cmake/init_target.cmake)
include(cmake/generate_target.cmake)
include(cmake/nuget.cmake)
Expand Down
2 changes: 2 additions & 0 deletions Telegram/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,8 @@ PRIVATE
media/stories/media_stories_sibling.h
media/stories/media_stories_slider.cpp
media/stories/media_stories_slider.h
media/stories/media_stories_stealth.cpp
media/stories/media_stories_stealth.h
media/stories/media_stories_view.cpp
media/stories/media_stories_view.h
media/streaming/media_streaming_audio_track.cpp
Expand Down
Binary file added Telegram/Resources/icons/chat/input_like.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/chat/input_like@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/chat/input_like@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/chat/input_liked.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/chat/input_liked@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/chat/input_liked@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/menu/antispam.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/menu/antispam@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/menu/antispam@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/menu/bot_commands.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/menu/bot_commands@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/menu/bot_commands@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/menu/calls_receive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/menu/chat_discuss.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/menu/chat_discuss@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/menu/chat_discuss@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/menu/devices.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/menu/devices@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/menu/devices@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/menu/dock_bounce.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/menu/dock_bounce@2x.png
Binary file added Telegram/Resources/icons/menu/dock_bounce@3x.png
Binary file added Telegram/Resources/icons/menu/download_locked.png
Binary file added Telegram/Resources/icons/menu/download_locked@2x.png
Binary file added Telegram/Resources/icons/menu/experimental.png
Binary file added Telegram/Resources/icons/menu/experimental@2x.png
Binary file added Telegram/Resources/icons/menu/experimental@3x.png
Binary file added Telegram/Resources/icons/menu/faq.png
Binary file added Telegram/Resources/icons/menu/faq@2x.png
Binary file added Telegram/Resources/icons/menu/faq@3x.png
Binary file added Telegram/Resources/icons/menu/group_log.png
Binary file added Telegram/Resources/icons/menu/group_log@2x.png
Binary file added Telegram/Resources/icons/menu/group_log@3x.png
Binary file added Telegram/Resources/icons/menu/group_reactions.png
Binary file added Telegram/Resources/icons/menu/groups_create.png
Binary file added Telegram/Resources/icons/menu/hide_members.png
Binary file added Telegram/Resources/icons/menu/hide_members@2x.png
Binary file added Telegram/Resources/icons/menu/hide_members@3x.png
Binary file added Telegram/Resources/icons/menu/info_notifications.png
Binary file added Telegram/Resources/icons/menu/links_profile.png
Binary file added Telegram/Resources/icons/menu/links_profile@2x.png
Binary file added Telegram/Resources/icons/menu/lock.png
Binary file added Telegram/Resources/icons/menu/lock@2x.png
Binary file added Telegram/Resources/icons/menu/lock@3x.png
Binary file added Telegram/Resources/icons/menu/network.png
Binary file added Telegram/Resources/icons/menu/network@2x.png
Binary file added Telegram/Resources/icons/menu/network@3x.png
Binary file added Telegram/Resources/icons/menu/payment_email.png
Binary file added Telegram/Resources/icons/menu/power_usage.png
Binary file added Telegram/Resources/icons/menu/power_usage@2x.png
Binary file added Telegram/Resources/icons/menu/power_usage@3x.png
Binary file added Telegram/Resources/icons/menu/recovery_email.png
Binary file added Telegram/Resources/icons/menu/recovery_email@2x.png
Binary file added Telegram/Resources/icons/menu/remove.png
Binary file added Telegram/Resources/icons/menu/remove@2x.png
Binary file added Telegram/Resources/icons/menu/remove@3x.png
Binary file added Telegram/Resources/icons/menu/signed.png
Binary file added Telegram/Resources/icons/menu/signed@2x.png
Binary file added Telegram/Resources/icons/menu/signed@3x.png
Binary file added Telegram/Resources/icons/menu/stealth.png
Binary file added Telegram/Resources/icons/menu/stealth@2x.png
Binary file added Telegram/Resources/icons/menu/stealth@3x.png
Binary file added Telegram/Resources/icons/menu/stealth_locked.png
Binary file removed Telegram/Resources/icons/menu/stop_poll.png
Diff not rendered.
Binary file removed Telegram/Resources/icons/menu/stop_poll@2x.png
Diff not rendered.
Binary file removed Telegram/Resources/icons/menu/stop_poll@3x.png
Diff not rendered.
Binary file added Telegram/Resources/icons/menu/storage.png
Binary file added Telegram/Resources/icons/menu/storage@2x.png
Binary file added Telegram/Resources/icons/menu/storage@3x.png
Binary file added Telegram/Resources/icons/menu/timer.png
Binary file added Telegram/Resources/icons/menu/timer@2x.png
Binary file added Telegram/Resources/icons/menu/timer@3x.png
Binary file added Telegram/Resources/icons/menu/topics.png
Binary file added Telegram/Resources/icons/menu/topics@2x.png
Binary file added Telegram/Resources/icons/menu/topics@3x.png
Binary file added Telegram/Resources/icons/settings/premium/timer.png
File renamed without changes
Binary file added Telegram/Resources/icons/stories/stealth_25m.png
Binary file added Telegram/Resources/icons/stories/stealth_5m.png
Binary file added Telegram/Resources/icons/stories/stealth_logo.png
68 changes: 68 additions & 0 deletions Telegram/Resources/langs/lang.strings
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_filter_chats_limit_title" = "Limit Reached";
"lng_filter_chats_limit1#one" = "Sorry, you can't add more than **{count}** chat to a folder.";
"lng_filter_chats_limit1#other" = "Sorry, you can't add more than **{count}** chats to a folder.";
"lng_filter_chats_exlude_limit1#one" = "Sorry, you can't exlude more than **{count}** chat from a folder.";
"lng_filter_chats_exlude_limit1#other" = "Sorry, you can't exlude more than **{count}** chats from a folder.";
"lng_filter_chats_limit2#one" = "You can increase this limit to **{count}** by upgrading to **Telegram Premium**.";
"lng_filter_chats_limit2#other" = "You can increase this limit to **{count}** by upgrading to **Telegram Premium**.";

Expand Down Expand Up @@ -270,6 +272,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_error_noforwards_channel" = "Sorry, forwarding from this channel is disabled by admins.";
"lng_error_nocopy_group" = "Sorry, copying from this group is disabled by admins.";
"lng_error_nocopy_channel" = "Sorry, copying from this channel is disabled by admins.";
"lng_error_nocopy_story" = "Sorry, copying of this story is disabled by the author.";
"lng_sure_add_admin_invite" = "This user is not a member of this group. Add them to the group and promote them to admin?";
"lng_sure_add_admin_invite_channel" = "This user is not a subscriber of this channel. Add them to the channel and promote them to admin?";
"lng_sure_add_admin_unremove" = "This user is currently restricted or removed. Are you sure you want to promote them?";
Expand Down Expand Up @@ -632,6 +635,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_settings_username_label" = "Username";
"lng_settings_phone_label" = "Phone number";
"lng_settings_username_add" = "Add username";
"lng_settings_username_about" = "Username lets people contact you on Telegram without needing your phone number.";
"lng_settings_add_account_about" = "You can add up to four accounts with different phone numbers.";
"lng_settings_peer_to_peer_about" = "Disabling peer-to-peer will relay all calls through Telegram servers to avoid revealing your IP address, but may slightly decrease audio quality.";
"lng_settings_advanced" = "Advanced";
"lng_settings_stickers_emoji" = "Stickers and emoji";
Expand All @@ -644,12 +649,20 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_settings_theme_accent_title" = "Choose accent color";
"lng_settings_data_storage" = "Data and storage";
"lng_settings_information" = "Edit profile";
"lng_settings_my_account" = "My Account";
"lng_settings_security" = "Security";
"lng_settings_passcode_title" = "Local passcode";
"lng_settings_sessions_title" = "Active sessions";
"lng_settings_sessions_about" = "Review the list of devices where you are logged into your Telegram account.";
"lng_settings_archive_title" = "Archive Settings";
"lng_settings_new_unknown" = "New chats from unknown users";
"lng_settings_auto_archive" = "Archive and Mute";
"lng_settings_auto_archive_about" = "Automatically archive and mute new chats, groups and channels from non-contacts.";
"lng_settings_unmuted_chats" = "Unmuted chats";
"lng_settings_always_in_archive" = "Always keep archived";
"lng_settings_unmuted_chats_about" = "Keep archived chats in the Archive even if they are unmuted and get a new message.";
"lng_settings_chats_from_folders" = "Chats from folders";
"lng_settings_chats_from_folders_about" = "Keep archived chats from folders in the Archive even if they are unmuted and get a new message.";
"lng_settings_destroy_title" = "Delete my account";
"lng_settings_version_info" = "Version and updates";
"lng_settings_system_integration" = "System integration";
Expand All @@ -668,6 +681,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_settings_sensitive_about" = "Display sensitive media in public channels on all your Telegram devices.";
"lng_settings_security_bots" = "Bots and websites";
"lng_settings_clear_payment_info" = "Clear Payment and Shipping Info";
"lng_settings_logged_in" = "Logged In with Telegram";
"lng_settings_logged_in_about" = "Websites where you've used Telegram to log in.";
"lng_settings_logged_in_title" = "Logged In with Telegram";
"lng_settings_logged_in_description" = "You can log in on websites that support signing in with Telegram.";
"lng_settings_disconnect_all" = "Disconnect All Websites";
"lng_settings_connected_title" = "Connected websites";
"lng_settings_connected_about" = "Click to disconnect from your Telegram account.";

"lng_settings_power_menu" = "Battery and Animations";
"lng_settings_power_title" = "Power Usage";
Expand Down Expand Up @@ -1860,6 +1880,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_premium_summary_subtitle_gift#other" = "{user} has gifted you a {count}-months subscription for Telegram Premium.";
"lng_premium_summary_subtitle_gift_me#one" = "You gifted {user} a {count}-month subscription for Telegram Premium.";
"lng_premium_summary_subtitle_gift_me#other" = "You gifted {user} a {count}-months subscription for Telegram Premium.";
"lng_premium_summary_subtitle_stories" = "Upgraded Stories";
"lng_premium_summary_about_stories" = "Priority order, stealth mode, permanent views history and more.";
"lng_premium_summary_subtitle_double_limits" = "Doubled Limits";
"lng_premium_summary_about_double_limits" = "Up to 1000 channels, 20 folders, 10 pins, 20 public links, 4 accounts and more.";
"lng_premium_summary_subtitle_more_upload" = "4Gb Upload Size";
Expand Down Expand Up @@ -1890,9 +1912,35 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_premium_summary_bottom_about" = "While the free version of Telegram already gives its users more than any other messaging application, **Telegram Premium** pushes its capabilities even further.\n\n**Telegram Premium** is a paid option, because most Premium Features require additional expenses from Telegram to third parties such as data center providers and server manufacturers. Contributions from **Telegram Premium** users allow us to cover such costs and also help Telegram stay free for everyone.";
"lng_premium_summary_button" = "Subscribe for {cost} per month";

"lng_premium_summary_new_badge" = "NEW";

"lng_premium_success" = "You've successfully subscribed to Telegram Premium!";
"lng_premium_unavailable" = "This feature requires subscription to **Telegram Premium**.\n\nUnfortunately, **Telegram Premium** is not available in your region.";

// Upgraded Stories.
"lng_premium_stories_subtitle_order" = "Priority Order";
"lng_premium_stories_about_order" = "Get more views as your stories are always displayed first.";

"lng_premium_stories_subtitle_stealth" = "Stealth Mode";
"lng_premium_stories_about_stealth" = "Hide the fact that you viewed other people's stories.";

"lng_premium_stories_subtitle_views" = "Permanent Views History";
"lng_premium_stories_about_views" = "Check who opens your stories – even after they expire.";

"lng_premium_stories_subtitle_expiration" = "Expiration Durations*";
"lng_premium_stories_about_expiration" = "Set custom expiration durations like 6 or 48 hours for your stories.";

"lng_premium_stories_subtitle_download" = "Download Stories";
"lng_premium_stories_about_download" = "Save other people's unprotected stories to your disk.";

"lng_premium_stories_subtitle_caption" = "Longer Captions*";
"lng_premium_stories_about_caption" = "Add ten times longer captions to your stories – up to 2048 symbols.";

"lng_premium_stories_subtitle_links" = "Links and Formatting*";
"lng_premium_stories_about_links" = "Add links and formatting in captions of your stories.";

"lng_premium_stories_about_mobile" = "* Available when posting stories from Telegram apps for iOS and Android.";

// Doubled Limits.
"lng_premium_double_limits_subtitle_channels" = "Groups and Channels";
"lng_premium_double_limits_about_channels#one" = "Join up to {count} channels and large groups";
Expand Down Expand Up @@ -2282,6 +2330,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_context_archive_to_menu" = "Move to main menu";
"lng_context_archive_to_list" = "Move to chats list";
"lng_context_archive_to_menu_info" = "Archive moved to the main menu!\nYou can return it from the context menu of the archive button.";
"lng_context_archive_settings" = "Archive settings";

"lng_context_mute" = "Mute";
"lng_context_unmute" = "Unmute";
Expand Down Expand Up @@ -3914,6 +3963,25 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_stories_archive_done" = "This story is hidden from your profile.";
"lng_stories_archive_done_many#one" = "{count} story is hidden from your profile.";
"lng_stories_archive_done_many#other" = "{count} stories are hidden from your profile.";
"lng_stories_save_promo" = "Subscribe to {link} to download other people's unprotected stories to disk.";

"lng_stealth_mode_menu_item" = "Stealth Mode";
"lng_stealth_mode_title" = "Stealth Mode";
"lng_stealth_mode_unlock_about" = "Subscribe to Telegram Premium to hide the fact that you viewed peoples' stories from them.";
"lng_stealth_mode_about" = "Turn Stealth Mode on to hide the fact that you viewed peoples' stories from them.";
"lng_stealth_mode_past_title" = "Hide Recent Views";
"lng_stealth_mode_past_about" = "Hide my views in the last 5 minutes.";
"lng_stealth_mode_next_title" = "Hide Next Views";
"lng_stealth_mode_next_about" = "Hide my views in the next 25 minutes.";
"lng_stealth_mode_unlock" = "Unlock Stealth Mode";
"lng_stealth_mode_enable" = "Enable Stealth Mode";
"lng_stealth_mode_cooldown_in" = "Available in {left}";
"lng_stealth_mode_cooldown_tip" = "Please wait until the **Stealth Mode** is ready to use again.";
"lng_stealth_mode_enabled_tip_title" = "Stealth Mode On";
"lng_stealth_mode_enabled_tip" = "The creators of stories you viewed in the last **5 minutes** or will view in the next **25 minutes** won't see you in the viewers' lists.";
"lng_stealth_mode_countdown" = "Stealth Mode active – {left}";
"lng_stealth_mode_already_title" = "You are in Stealth Mode";
"lng_stealth_mode_already_about" = "The creators of stories you will view in the next **{left}** won't see you in the viewers' lists.";

"lng_stories_link_invalid" = "This link is broken or has expired.";

Expand Down
2 changes: 1 addition & 1 deletion Telegram/Resources/uwp/AppX/AppxManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Identity Name="TelegramMessengerLLP.TelegramDesktop"
ProcessorArchitecture="ARCHITECTURE"
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
Version="4.8.10.0" />
Version="4.9.0.0" />
<Properties>
<DisplayName>Telegram Desktop</DisplayName>
<PublisherDisplayName>Telegram Messenger LLP</PublisherDisplayName>
Expand Down
8 changes: 4 additions & 4 deletions Telegram/Resources/winrc/Telegram.rc
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,8,10,0
PRODUCTVERSION 4,8,10,0
FILEVERSION 4,9,0,0
PRODUCTVERSION 4,9,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -62,10 +62,10 @@ BEGIN
BEGIN
VALUE "CompanyName", ""
VALUE "FileDescription", "Telegram Desktop"
VALUE "FileVersion", "4.8.10.0"
VALUE "FileVersion", "4.9.0.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2023"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "4.8.10.0"
VALUE "ProductVersion", "4.9.0.0"
END
END
BLOCK "VarFileInfo"
Expand Down
8 changes: 4 additions & 4 deletions Telegram/Resources/winrc/Updater.rc
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,8,10,0
PRODUCTVERSION 4,8,10,0
FILEVERSION 4,9,0,0
PRODUCTVERSION 4,9,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -53,10 +53,10 @@ BEGIN
BEGIN
VALUE "CompanyName", ""
VALUE "FileDescription", "Telegram Desktop Updater"
VALUE "FileVersion", "4.8.10.0"
VALUE "FileVersion", "4.9.0.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2023"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "4.8.10.0"
VALUE "ProductVersion", "4.9.0.0"
END
END
BLOCK "VarFileInfo"
Expand Down
3 changes: 3 additions & 0 deletions Telegram/SourceFiles/api/api_blocked_peers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ void BlockedPeers::block(not_null<PeerData*> peer) {
Data::PeerUpdate::Flag::IsBlocked);
} else if (_blockRequests.find(peer) == end(_blockRequests)) {
const auto requestId = _api.request(MTPcontacts_Block(
MTP_flags(0),
peer->input
)).done([=] {
_blockRequests.erase(peer);
Expand Down Expand Up @@ -111,6 +112,7 @@ void BlockedPeers::unblock(
return;
}
const auto requestId = _api.request(MTPcontacts_Unblock(
MTP_flags(0),
peer->input
)).done([=] {
_blockRequests.erase(peer);
Expand Down Expand Up @@ -163,6 +165,7 @@ void BlockedPeers::request(int offset, Fn<void(BlockedPeers::Slice)> onDone) {
return;
}
_requestId = _api.request(MTPcontacts_GetBlocked(
MTP_flags(0),
MTP_int(offset),
MTP_int(offset ? kBlockedPerPage : kBlockedFirstSlice)
)).done([=](const MTPcontacts_Blocked &result) {
Expand Down
2 changes: 1 addition & 1 deletion Telegram/SourceFiles/api/api_chat_filters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ void ShowImportError(
if (error == u"CHANNELS_TOO_MUCH"_q) {
window->show(Box(ChannelsLimitBox, session));
} else if (error == u"FILTER_INCLUDE_TOO_MUCH"_q) {
window->show(Box(FilterChatsLimitBox, session, count));
window->show(Box(FilterChatsLimitBox, session, count, true));
} else if (error == u"CHATLISTS_TOO_MUCH"_q) {
window->show(Box(ShareableFiltersLimitBox, session));
} else {
Expand Down
2 changes: 2 additions & 0 deletions Telegram/SourceFiles/api/api_chat_participants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ void ChatParticipants::requestAdmins(not_null<ChannelData*> channel) {
MTP_int(channel->session().serverConfig().chatSizeMax),
MTP_long(participantsHash)
)).done([=](const MTPchannels_ChannelParticipants &result) {
channel->mgInfo->adminsLoaded = true;
_adminsRequests.remove(channel);
result.match([&](const MTPDchannels_channelParticipants &data) {
channel->owner().processUsers(data.vusers());
Expand All @@ -448,6 +449,7 @@ void ChatParticipants::requestAdmins(not_null<ChannelData*> channel) {
"channels.channelParticipantsNotModified received!"));
});
}).fail([=] {
channel->mgInfo->adminsLoaded = true;
_adminsRequests.remove(channel);
}).send();

Expand Down
19 changes: 15 additions & 4 deletions Telegram/SourceFiles/api/api_global_privacy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,29 @@ void GlobalPrivacy::dismissArchiveAndMuteSuggestion() {
u"AUTOARCHIVE_POPULAR"_q);
}

void GlobalPrivacy::update(bool archiveAndMute) {
void GlobalPrivacy::updateArchiveAndMute(bool value) {
update(value, unarchiveOnNewMessageCurrent());
}

void GlobalPrivacy::updateUnarchiveOnNewMessage(
UnarchiveOnNewMessage value) {
update(archiveAndMuteCurrent(), value);
}

void GlobalPrivacy::update(
bool archiveAndMute,
UnarchiveOnNewMessage unarchiveOnNewMessage) {
using Flag = MTPDglobalPrivacySettings::Flag;

const auto unarchive = unarchiveOnNewMessageCurrent();
_api.request(_requestId).cancel();
const auto flags = Flag()
| (archiveAndMute
? Flag::f_archive_and_mute_new_noncontact_peers
: Flag())
| (unarchive == UnarchiveOnNewMessage::AnyUnmuted
| (unarchiveOnNewMessage == UnarchiveOnNewMessage::AnyUnmuted
? Flag::f_keep_archived_unmuted
: Flag())
| (unarchive != UnarchiveOnNewMessage::None
| (unarchiveOnNewMessage != UnarchiveOnNewMessage::None
? Flag::f_keep_archived_folders
: Flag());
_requestId = _api.request(MTPaccount_SetGlobalPrivacySettings(
Expand All @@ -108,6 +118,7 @@ void GlobalPrivacy::update(bool archiveAndMute) {
_requestId = 0;
}).send();
_archiveAndMute = archiveAndMute;
_unarchiveOnNewMessage = unarchiveOnNewMessage;
}

void GlobalPrivacy::apply(const MTPGlobalPrivacySettings &data) {
Expand Down
7 changes: 6 additions & 1 deletion Telegram/SourceFiles/api/api_global_privacy.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class GlobalPrivacy final {
explicit GlobalPrivacy(not_null<ApiWrap*> api);

void reload(Fn<void()> callback = nullptr);
void update(bool archiveAndMute);
void updateArchiveAndMute(bool value);
void updateUnarchiveOnNewMessage(UnarchiveOnNewMessage value);

[[nodiscard]] bool archiveAndMuteCurrent() const;
[[nodiscard]] rpl::producer<bool> archiveAndMute() const;
Expand All @@ -43,6 +44,10 @@ class GlobalPrivacy final {
private:
void apply(const MTPGlobalPrivacySettings &data);

void update(
bool archiveAndMute,
UnarchiveOnNewMessage unarchiveOnNewMessage);

const not_null<Main::Session*> _session;
MTP::Sender _api;
mtpRequestId _requestId = 0;
Expand Down
2 changes: 1 addition & 1 deletion Telegram/SourceFiles/api/api_sending.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,6 @@ void SendConfirmedFile(
}());

if (itemToEdit) {
itemToEdit->savePreviousMedia();
auto edition = HistoryMessageEdition();
edition.isEditHide = (flags & MessageFlag::HideEdited);
edition.editDate = 0;
Expand All @@ -509,6 +508,7 @@ void SendConfirmedFile(
edition.useSameMarkup = true;
edition.useSameReplies = true;
edition.useSameReactions = true;
edition.savePreviousMedia = true;
itemToEdit->applyEdition(std::move(edition));
} else {
const auto viaBotId = UserId();
Expand Down
7 changes: 6 additions & 1 deletion Telegram/SourceFiles/api/api_updates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1987,7 +1987,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
case mtpc_updatePeerBlocked: {
const auto &d = update.c_updatePeerBlocked();
if (const auto peer = session().data().peerLoaded(peerFromMTP(d.vpeer_id()))) {
peer->setIsBlocked(mtpIsTrue(d.vblocked()));
peer->setIsBlocked(d.is_blocked());
}
} break;

Expand Down Expand Up @@ -2528,6 +2528,11 @@ void Updates::feedUpdate(const MTPUpdate &update) {
_session->data().stories().apply(update.c_updateReadStories());
} break;

case mtpc_updateStoriesStealthMode: {
const auto &data = update.c_updateStoriesStealthMode();
_session->data().stories().apply(data.vstealth_mode());
} break;

}
}

Expand Down
2 changes: 1 addition & 1 deletion Telegram/SourceFiles/apiwrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3417,7 +3417,7 @@ void ApiWrap::sendSharedContact(
void ApiWrap::sendVoiceMessage(
QByteArray result,
VoiceWaveform waveform,
int duration,
crl::time duration,
const SendAction &action) {
const auto caption = TextWithTags();
const auto to = fileLoadTaskOptions(action);
Expand Down
2 changes: 1 addition & 1 deletion Telegram/SourceFiles/apiwrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ class ApiWrap final : public MTP::Sender {
void sendVoiceMessage(
QByteArray result,
VoiceWaveform waveform,
int duration,
crl::time duration,
const SendAction &action);
void sendFiles(
Ui::PreparedList &&list,
Expand Down
Loading

0 comments on commit 895cea4

Please sign in to comment.