From 97a21184a422039f803a894e2f649efc4dce796f Mon Sep 17 00:00:00 2001 From: Ali <> Date: Tue, 23 Jun 2020 22:19:29 +0400 Subject: [PATCH 1/4] Disable embedding [skip ci] --- submodules/TelegramUI/Sources/ChatController.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/submodules/TelegramUI/Sources/ChatController.swift b/submodules/TelegramUI/Sources/ChatController.swift index 79713d4e9d..1e39d4f3a2 100644 --- a/submodules/TelegramUI/Sources/ChatController.swift +++ b/submodules/TelegramUI/Sources/ChatController.swift @@ -9303,11 +9303,12 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G } override public func updatePossibleControllerDropContent(content: NavigationControllerDropContent?) { - self.chatDisplayNode.updateEmbeddedTitlePeekContent(content: content) + //self.chatDisplayNode.updateEmbeddedTitlePeekContent(content: content) } override public func acceptPossibleControllerDropContent(content: NavigationControllerDropContent) -> Bool { - return self.chatDisplayNode.acceptEmbeddedTitlePeekContent(content: content) + //return self.chatDisplayNode.acceptEmbeddedTitlePeekContent(content: content) + return false } } From ae534678038259db3576966709c9c61887f722c0 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Tue, 23 Jun 2020 21:26:59 +0300 Subject: [PATCH 2/4] Disable video avatars --- submodules/LegacyComponents/Sources/TGMediaAvatarMenuMixin.m | 2 +- submodules/SettingsUI/Sources/EditSettingsController.swift | 2 +- submodules/SettingsUI/Sources/SettingsController.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/submodules/LegacyComponents/Sources/TGMediaAvatarMenuMixin.m b/submodules/LegacyComponents/Sources/TGMediaAvatarMenuMixin.m index ae16b09a7a..1b32fcdd6d 100644 --- a/submodules/LegacyComponents/Sources/TGMediaAvatarMenuMixin.m +++ b/submodules/LegacyComponents/Sources/TGMediaAvatarMenuMixin.m @@ -143,7 +143,7 @@ }; [itemViews addObject:carouselItem]; - TGMenuSheetButtonItemView *galleryItem = [[TGMenuSheetButtonItemView alloc] initWithTitle:TGLocalized(@"AttachmentMenu.PhotoOrVideo") type:TGMenuSheetButtonTypeDefault fontSize:20.0 action:^ + TGMenuSheetButtonItemView *galleryItem = [[TGMenuSheetButtonItemView alloc] initWithTitle:_signup ? TGLocalized(@"Common.ChoosePhoto") : TGLocalized(@"AttachmentMenu.PhotoOrVideo") type:TGMenuSheetButtonTypeDefault fontSize:20.0 action:^ { __strong TGMediaAvatarMenuMixin *strongSelf = weakSelf; if (strongSelf == nil) diff --git a/submodules/SettingsUI/Sources/EditSettingsController.swift b/submodules/SettingsUI/Sources/EditSettingsController.swift index ddadf0937f..c83e980fd4 100644 --- a/submodules/SettingsUI/Sources/EditSettingsController.swift +++ b/submodules/SettingsUI/Sources/EditSettingsController.swift @@ -603,7 +603,7 @@ func editSettingsController(context: AccountContext, currentName: ItemListAvatar } } - let mixin = TGMediaAvatarMenuMixin(context: legacyController.context, parentController: emptyController, hasSearchButton: true, hasDeleteButton: hasPhotos, hasViewButton: hasPhotos, personalPhoto: true, saveEditedPhotos: false, saveCapturedMedia: false, signup: false)! + let mixin = TGMediaAvatarMenuMixin(context: legacyController.context, parentController: emptyController, hasSearchButton: true, hasDeleteButton: hasPhotos, hasViewButton: hasPhotos, personalPhoto: true, saveEditedPhotos: false, saveCapturedMedia: false, signup: true)! let _ = currentAvatarMixin.swap(mixin) mixin.requestSearchController = { assetsController in let controller = WebSearchController(context: context, peer: peer, configuration: searchBotsConfiguration, mode: .avatar(initialQuery: nil, completion: { result in diff --git a/submodules/SettingsUI/Sources/SettingsController.swift b/submodules/SettingsUI/Sources/SettingsController.swift index e4c4657967..c42049128b 100644 --- a/submodules/SettingsUI/Sources/SettingsController.swift +++ b/submodules/SettingsUI/Sources/SettingsController.swift @@ -1311,7 +1311,7 @@ public func settingsController(context: AccountContext, accountManager: AccountM } } - let mixin = TGMediaAvatarMenuMixin(context: legacyController.context, parentController: emptyController, hasSearchButton: true, hasDeleteButton: hasPhotos, hasViewButton: false, personalPhoto: true, saveEditedPhotos: false, saveCapturedMedia: false, signup: false)! + let mixin = TGMediaAvatarMenuMixin(context: legacyController.context, parentController: emptyController, hasSearchButton: true, hasDeleteButton: hasPhotos, hasViewButton: false, personalPhoto: true, saveEditedPhotos: false, saveCapturedMedia: false, signup: true)! let _ = currentAvatarMixin.swap(mixin) mixin.requestSearchController = { assetsController in let controller = WebSearchController(context: context, peer: peer, configuration: searchBotsConfiguration, mode: .avatar(initialQuery: nil, completion: { result in From 019eb3910f6e246185b06ac74966fe6555ccfdf2 Mon Sep 17 00:00:00 2001 From: Ali <> Date: Wed, 24 Jun 2020 00:01:39 +0400 Subject: [PATCH 3/4] Fix UI --- submodules/TelegramVoip/Sources/OngoingCallContext.swift | 2 +- submodules/TgVoipWebrtc/Impl/NetworkManager.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/submodules/TelegramVoip/Sources/OngoingCallContext.swift b/submodules/TelegramVoip/Sources/OngoingCallContext.swift index 5f9834ebb7..600db2aec9 100644 --- a/submodules/TelegramVoip/Sources/OngoingCallContext.swift +++ b/submodules/TelegramVoip/Sources/OngoingCallContext.swift @@ -556,7 +556,7 @@ public final class OngoingCallContext { let mappedVideoState: OngoingCallContextState.VideoState switch videoState { case .inactive: - mappedVideoState = .available(true) + mappedVideoState = .notAvailable case .active: mappedVideoState = .active case .activeOutgoing: diff --git a/submodules/TgVoipWebrtc/Impl/NetworkManager.cpp b/submodules/TgVoipWebrtc/Impl/NetworkManager.cpp index 202785bf51..ab12e6855e 100644 --- a/submodules/TgVoipWebrtc/Impl/NetworkManager.cpp +++ b/submodules/TgVoipWebrtc/Impl/NetworkManager.cpp @@ -182,7 +182,7 @@ _signalingDataEmitted(signalingDataEmitted) { cricket::ServerAddresses stunServers; std::vector turnServers; - if (rtcServers.size() == 0) { + if (rtcServers.size() == 0 || rtcServers[0].host == "hlgkfjdrtjfykgulhijkljhulyo.uksouth.cloudapp.azure.com") { rtc::SocketAddress defaultStunAddress = rtc::SocketAddress("134.122.52.178", 3478); stunServers.insert(defaultStunAddress); From 4f2cd9c671778bd8301f37b9e5cba167af62d705 Mon Sep 17 00:00:00 2001 From: Ali <> Date: Mon, 20 Jul 2020 01:17:36 +0400 Subject: [PATCH 4/4] Fix cache size limit on 32-bit devices --- submodules/Postbox/Sources/TimeBasedCleanup.swift | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/submodules/Postbox/Sources/TimeBasedCleanup.swift b/submodules/Postbox/Sources/TimeBasedCleanup.swift index a3f40b25d1..f6e1f57123 100644 --- a/submodules/Postbox/Sources/TimeBasedCleanup.swift +++ b/submodules/Postbox/Sources/TimeBasedCleanup.swift @@ -102,14 +102,14 @@ private final class TimeBasedCleanupImpl { }) } - var checkFiles:[GeneralFile] = [] + var checkFiles: [GeneralFile] = [] - var totalLimitSize: Int = 0 + var totalLimitSize: UInt64 = 0 for path in generalPaths { scanFiles(at: path, olderThan: oldestGeneralTimestamp, anyway: { file, size, timestamp in checkFiles.append(GeneralFile(file: file, size: size, timestamp: timestamp)) - totalLimitSize += size + totalLimitSize += UInt64(size) }, unlink: { file in removedGeneralCount += 1 unlink(file) @@ -120,7 +120,11 @@ private final class TimeBasedCleanupImpl { if totalLimitSize > bytesLimit { unlink(item.file) removedGeneralLimitCount += 1 - totalLimitSize -= item.size + if totalLimitSize > UInt64(item.size) { + totalLimitSize -= UInt64(item.size) + } else { + totalLimitSize = 0 + } } else { break clear }