From f23c23f6969f428ec2b2600c5e4b80544dbac97a Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 7 Feb 2018 19:37:05 +0300 Subject: [PATCH] Closed beta 1.2.8.5. --- Telegram/Resources/scheme.tl | 18 ++++----- Telegram/Resources/uwp/AppX/AppxManifest.xml | 2 +- Telegram/Resources/winrc/Telegram.rc | 8 ++-- Telegram/Resources/winrc/Updater.rc | 8 ++-- Telegram/SourceFiles/apiwrap.cpp | 4 ++ Telegram/SourceFiles/core/version.h | 2 +- Telegram/SourceFiles/data/data_feed.cpp | 18 ++++++--- .../feed/info_feed_profile_inner_widget.cpp | 38 +++++++++---------- .../info/members/info_members_widget.cpp | 1 - Telegram/build/version | 2 +- 10 files changed, 55 insertions(+), 46 deletions(-) diff --git a/Telegram/Resources/scheme.tl b/Telegram/Resources/scheme.tl index 599e3c6a4..0233f4746 100644 --- a/Telegram/Resources/scheme.tl +++ b/Telegram/Resources/scheme.tl @@ -273,7 +273,7 @@ messageActionCustomAction#fae69f56 message:string = MessageAction; messageActionBotAllowed#abe9affe domain:string = MessageAction; dialog#e4def5db flags:# pinned:flags.2?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage = Dialog; -dialogFeed#36086d42 flags:# pinned:flags.2?true peer:Peer top_message:int feed_id:int feed_other_channels:Vector read_max_position:flags.3?FeedPosition unread_count:int unread_muted_count:int = Dialog; +dialogFeed#907750e4 flags:# pinned:flags.2?true peer:Peer top_message:int feed_id:int feed_other_channels:Vector read_max_position:flags.3?FeedPosition unread_count:int unread_muted_count:int sources_hash:int = Dialog; photoEmpty#2331b22d id:long = Photo; photo#9288dd29 flags:# has_stickers:flags.0?true id:long access_hash:long date:int sizes:Vector = Photo; @@ -942,6 +942,14 @@ help.recentMeUrls#e0310d7 urls:Vector chats:Vector users:Vect inputSingleMedia#1cc6e91f flags:# media:InputMedia random_id:long message:string entities:flags.0?Vector = InputSingleMedia; +webAuthorization#cac943f2 hash:long bot_id:int domain:string browser:string platform:string date_created:int date_active:int ip:string region:string = WebAuthorization; + +account.webAuthorizations#ed56c9fc authorizations:Vector users:Vector = account.WebAuthorizations; + +inputMessageID#a676a322 id:int = InputMessage; +inputMessageReplyTo#bad88395 id:int = InputMessage; +inputMessagePinned#86872538 = InputMessage; + feedPosition#5059dc73 date:int peer:Peer id:int = FeedPosition; messages.feedMessagesNotModified#4678d0cf = messages.FeedMessages; @@ -959,14 +967,6 @@ inputDialogPeer#fcaafeb7 peer:InputPeer = InputDialogPeer; dialogPeerFeed#da429411 feed_id:int = DialogPeer; dialogPeer#e56dbf05 peer:Peer = DialogPeer; -webAuthorization#cac943f2 hash:long bot_id:int domain:string browser:string platform:string date_created:int date_active:int ip:string region:string = WebAuthorization; - -account.webAuthorizations#ed56c9fc authorizations:Vector users:Vector = account.WebAuthorizations; - -inputMessageID#a676a322 id:int = InputMessage; -inputMessageReplyTo#bad88395 id:int = InputMessage; -inputMessagePinned#86872538 = InputMessage; - ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; diff --git a/Telegram/Resources/uwp/AppX/AppxManifest.xml b/Telegram/Resources/uwp/AppX/AppxManifest.xml index b329b3244..5ad78edfb 100644 --- a/Telegram/Resources/uwp/AppX/AppxManifest.xml +++ b/Telegram/Resources/uwp/AppX/AppxManifest.xml @@ -9,7 +9,7 @@ + Version="1.2.8.5" /> Telegram Desktop Telegram Messenger LLP diff --git a/Telegram/Resources/winrc/Telegram.rc b/Telegram/Resources/winrc/Telegram.rc index 8f8918773..d5c40c607 100644 --- a/Telegram/Resources/winrc/Telegram.rc +++ b/Telegram/Resources/winrc/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,2,8,4 - PRODUCTVERSION 1,2,8,4 + FILEVERSION 1,2,8,5 + PRODUCTVERSION 1,2,8,5 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -52,10 +52,10 @@ BEGIN BEGIN VALUE "CompanyName", "Telegram Messenger LLP" VALUE "FileDescription", "Telegram Desktop" - VALUE "FileVersion", "1.2.8.4" + VALUE "FileVersion", "1.2.8.5" VALUE "LegalCopyright", "Copyright (C) 2014-2018" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "1.2.8.4" + VALUE "ProductVersion", "1.2.8.5" END END BLOCK "VarFileInfo" diff --git a/Telegram/Resources/winrc/Updater.rc b/Telegram/Resources/winrc/Updater.rc index b1a1719b0..815fd8670 100644 --- a/Telegram/Resources/winrc/Updater.rc +++ b/Telegram/Resources/winrc/Updater.rc @@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,2,8,4 - PRODUCTVERSION 1,2,8,4 + FILEVERSION 1,2,8,5 + PRODUCTVERSION 1,2,8,5 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -43,10 +43,10 @@ BEGIN BEGIN VALUE "CompanyName", "Telegram Messenger LLP" VALUE "FileDescription", "Telegram Desktop Updater" - VALUE "FileVersion", "1.2.8.4" + VALUE "FileVersion", "1.2.8.5" VALUE "LegalCopyright", "Copyright (C) 2014-2018" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "1.2.8.4" + VALUE "ProductVersion", "1.2.8.5" END END BLOCK "VarFileInfo" diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index fa4fcc0c8..cd83e853a 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -3068,6 +3068,10 @@ void ApiWrap::requestFeedMessages( feedMessagesDone(feed, messageId, slice, result); }).fail([=](const RPCError &error) { _feedMessagesRequests.remove(key); + if (error.type() == qstr("SOURCES_HASH_INVALID")) { + _feedMessagesRequestsPending.emplace(key); + requestFeedChannels(feed); + } }).send(); _feedMessagesRequests.emplace(key); } diff --git a/Telegram/SourceFiles/core/version.h b/Telegram/SourceFiles/core/version.h index 0e23c10d3..c73abd026 100644 --- a/Telegram/SourceFiles/core/version.h +++ b/Telegram/SourceFiles/core/version.h @@ -9,7 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "core/utils.h" -#define BETA_VERSION_MACRO (1002008004ULL) +#define BETA_VERSION_MACRO (1002008005ULL) constexpr int AppVersion = 1002008; constexpr str_const AppVersionStr = "1.2.8"; diff --git a/Telegram/SourceFiles/data/data_feed.cpp b/Telegram/SourceFiles/data/data_feed.cpp index 1cf5adc62..575e6ce92 100644 --- a/Telegram/SourceFiles/data/data_feed.cpp +++ b/Telegram/SourceFiles/data/data_feed.cpp @@ -165,11 +165,12 @@ const std::vector> &Feed::channels() const { } int32 Feed::channelsHash() const { - return Api::CountHash(ranges::view::all( + const auto ordered = ranges::view::all( _channels ) | ranges::view::transform([](not_null history) { return history->peer->bareId(); - })); + }) | ranges::to_vector | ranges::action::sort; + return Api::CountHash(ordered); } bool Feed::channelsLoaded() const { @@ -177,7 +178,10 @@ bool Feed::channelsLoaded() const { } void Feed::setChannelsLoaded(bool loaded) { - _channelsLoaded = loaded; + if (_channelsLoaded != loaded) { + _channelsLoaded = loaded; + _parent->notifyFeedUpdated(this, FeedUpdateFlag::Channels); + } } void Feed::setChannels(std::vector> channels) { @@ -219,9 +223,7 @@ void Feed::setChannels(std::vector> channels) { _channels.push_back(App::history(channel)); } - _channelsLoaded = true; - - _parent->notifyFeedUpdated(this, FeedUpdateFlag::Channels); + setChannelsLoaded(true); } bool Feed::justUpdateLastMessage(not_null item) { @@ -326,6 +328,10 @@ void Feed::applyDialog(const MTPDdialogFeed &data) { if (data.has_read_max_position()) { setUnreadPosition(FeedPositionFromMTP(data.vread_max_position)); } + + if (channelsHash() != data.vsources_hash.v) { + setChannelsLoaded(false); + } } void Feed::setUnreadCounts(int unreadNonMutedCount, int unreadMutedCount) { diff --git a/Telegram/SourceFiles/info/feed/info_feed_profile_inner_widget.cpp b/Telegram/SourceFiles/info/feed/info_feed_profile_inner_widget.cpp index 2fee32e9b..c88fdbb1d 100644 --- a/Telegram/SourceFiles/info/feed/info_feed_profile_inner_widget.cpp +++ b/Telegram/SourceFiles/info/feed/info_feed_profile_inner_widget.cpp @@ -40,26 +40,26 @@ object_ptr InnerWidget::setupContent( _cover = result->add(object_ptr( result, _controller)); - auto details = Profile::SetupFeedDetails(_controller, parent, _feed); - result->add(std::move(details)); - result->add(object_ptr(result)); + //auto details = Profile::SetupFeedDetails(_controller, parent, _feed); + //result->add(std::move(details)); + //result->add(object_ptr(result)); - _channels = result->add(object_ptr( - result, - _controller) - ); - _channels->scrollToRequests( - ) | rpl::start_with_next([this](Ui::ScrollToRequest request) { - auto min = (request.ymin < 0) - ? request.ymin - : mapFromGlobal(_channels->mapToGlobal({ 0, request.ymin })).y(); - auto max = (request.ymin < 0) - ? mapFromGlobal(_channels->mapToGlobal({ 0, 0 })).y() - : (request.ymax < 0) - ? request.ymax - : mapFromGlobal(_channels->mapToGlobal({ 0, request.ymax })).y(); - _scrollToRequests.fire({ min, max }); - }, _channels->lifetime()); + //_channels = result->add(object_ptr( + // result, + // _controller) + //); + //_channels->scrollToRequests( + //) | rpl::start_with_next([this](Ui::ScrollToRequest request) { + // auto min = (request.ymin < 0) + // ? request.ymin + // : mapFromGlobal(_channels->mapToGlobal({ 0, request.ymin })).y(); + // auto max = (request.ymin < 0) + // ? mapFromGlobal(_channels->mapToGlobal({ 0, 0 })).y() + // : (request.ymax < 0) + // ? request.ymax + // : mapFromGlobal(_channels->mapToGlobal({ 0, request.ymax })).y(); + // _scrollToRequests.fire({ min, max }); + //}, _channels->lifetime()); return std::move(result); } diff --git a/Telegram/SourceFiles/info/members/info_members_widget.cpp b/Telegram/SourceFiles/info/members/info_members_widget.cpp index d79a7d07b..d51928c74 100644 --- a/Telegram/SourceFiles/info/members/info_members_widget.cpp +++ b/Telegram/SourceFiles/info/members/info_members_widget.cpp @@ -97,4 +97,3 @@ void Widget::restoreState(not_null memento) { } // namespace Members } // namespace Info - diff --git a/Telegram/build/version b/Telegram/build/version index 20571d344..4d5b4bd06 100644 --- a/Telegram/build/version +++ b/Telegram/build/version @@ -3,4 +3,4 @@ AppVersionStrMajor 1.2 AppVersionStrSmall 1.2.8 AppVersionStr 1.2.8 AlphaChannel 0 -BetaVersion 1002008004 +BetaVersion 1002008005