Skip to content

Commit 98433a4

Browse files
author
Isaac
committed
Merge commit '85b6a8ffe96bf8a5b1c7c5b5180024bc07770ba2'
2 parents 3797f3a + 85b6a8f commit 98433a4

File tree

92 files changed

+5076
-874
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+5076
-874
lines changed

Telegram/Telegram-iOS/en.lproj/Localizable.strings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13218,3 +13218,6 @@ Sorry for the inconvenience.";
1321813218
"Gift.Convert.Period.Unavailable.Text" = "Sorry, you can't convert this gift.\n\nStars can only be claimed within %@ after receiving a gift.";
1321913219
"Gift.Convert.Period.Unavailable.Days_1" = "%@ day";
1322013220
"Gift.Convert.Period.Unavailable.Days_any" = "%@ days";
13221+
13222+
"Gift.Send.TitleTo" = "Gift to %@";
13223+
"Gift.Send.SendShort" = "Send";

submodules/AccountContext/Sources/AccountContext.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,12 @@ public enum StickerPackUrlType {
278278
case emoji
279279
}
280280

281+
public enum ResolvedStartAppMode {
282+
case generic
283+
case compact
284+
case fullscreen
285+
}
286+
281287
public enum ResolvedUrl {
282288
case externalUrl(String)
283289
case urlAuth(String)
@@ -1044,7 +1050,7 @@ public protocol SharedAccountContext: AnyObject {
10441050
func makeMiniAppListScreenInitialData(context: AccountContext) -> Signal<MiniAppListScreenInitialData, NoError>
10451051
func makeMiniAppListScreen(context: AccountContext, initialData: MiniAppListScreenInitialData) -> ViewController
10461052

1047-
func openWebApp(context: AccountContext, parentController: ViewController, updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)?, peer: EnginePeer, threadId: Int64?, buttonText: String, url: String, simple: Bool, source: ChatOpenWebViewSource, skipTermsOfService: Bool, payload: String?)
1053+
func openWebApp(context: AccountContext, parentController: ViewController, updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)?, botPeer: EnginePeer, chatPeer: EnginePeer?, threadId: Int64?, buttonText: String, url: String, simple: Bool, source: ChatOpenWebViewSource, skipTermsOfService: Bool, payload: String?)
10481054

10491055
func makeDebugSettingsController(context: AccountContext?) -> ViewController?
10501056

submodules/AccountContext/Sources/ChatController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,13 @@ public struct ChatControllerInitialBotAppStart {
301301
public let botApp: BotApp?
302302
public let payload: String?
303303
public let justInstalled: Bool
304-
public let compact: Bool
304+
public let mode: ResolvedStartAppMode
305305

306-
public init(botApp: BotApp?, payload: String?, justInstalled: Bool, compact: Bool) {
306+
public init(botApp: BotApp?, payload: String?, justInstalled: Bool, mode: ResolvedStartAppMode) {
307307
self.botApp = botApp
308308
self.payload = payload
309309
self.justInstalled = justInstalled
310-
self.compact = compact
310+
self.mode = mode
311311
}
312312
}
313313

submodules/AttachmentUI/Sources/AttachmentContainer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ final class AttachmentContainer: ASDisplayNode, ASGestureRecognizerDelegate {
524524
}
525525

526526
var containerTopInset: CGFloat
527-
if isLandscape {
527+
if isLandscape || controllers.last?.isFullscreen == true {
528528
containerTopInset = 0.0
529529
containerLayout = layout
530530

submodules/AttachmentUI/Sources/AttachmentController.swift

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public protocol AttachmentContainable: ViewController, MinimizableController {
124124
var isInnerPanGestureEnabled: (() -> Bool)? { get }
125125
var mediaPickerContext: AttachmentMediaPickerContext? { get }
126126
var getCurrentSendMessageContextMediaPreview: (() -> ChatSendMessageContextScreenMediaPreview?)? { get }
127-
127+
128128
func isContainerPanningUpdated(_ panning: Bool)
129129

130130
func resetForReuse()
@@ -165,6 +165,10 @@ public extension AttachmentContainable {
165165
return nil
166166
}
167167

168+
var isFullscreen: Bool {
169+
return false
170+
}
171+
168172
var minimizedTopEdgeOffset: CGFloat? {
169173
return nil
170174
}
@@ -363,6 +367,10 @@ public class AttachmentController: ViewController, MinimizableController {
363367
public var minimizedIcon: UIImage? {
364368
return self.mainController.minimizedIcon
365369
}
370+
371+
public var isFullscreen: Bool {
372+
return self.mainController.isFullscreen
373+
}
366374

367375
private final class Node: ASDisplayNode {
368376
private weak var controller: AttachmentController?
@@ -1268,6 +1276,10 @@ public class AttachmentController: ViewController, MinimizableController {
12681276

12691277
public var ensureUnfocused = true
12701278

1279+
public func requestMinimize(topEdgeOffset: CGFloat?, initialVelocity: CGFloat?) {
1280+
self.node.minimize()
1281+
}
1282+
12711283
public override func dismiss(animated flag: Bool, completion: (() -> Void)? = nil) {
12721284
if self.ensureUnfocused {
12731285
self.view.endEditing(true)
@@ -1397,7 +1409,9 @@ public class AttachmentController: ViewController, MinimizableController {
13971409
public func makeContentSnapshotView() -> UIView? {
13981410
let snapshotView = self.view.snapshotView(afterScreenUpdates: false)
13991411
if let contentSnapshotView = self.mainController.makeContentSnapshotView() {
1400-
contentSnapshotView.frame = contentSnapshotView.frame.offsetBy(dx: 0.0, dy: 64.0 + 56.0)
1412+
if !self.mainController.isFullscreen {
1413+
contentSnapshotView.frame = contentSnapshotView.frame.offsetBy(dx: 0.0, dy: 64.0 + 56.0)
1414+
}
14011415
snapshotView?.addSubview(contentSnapshotView)
14021416
}
14031417
return snapshotView

submodules/BrowserUI/Sources/BrowserWebContent.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -638,8 +638,11 @@ final class BrowserWebContent: UIView, BrowserContent, WKNavigationDelegate, WKU
638638
self.webView.reloadInputViews()
639639
}
640640

641-
self.webView.customBottomInset = safeInsets.bottom * (1.0 - insets.bottom / fullInsets.bottom)
642-
641+
if fullInsets.bottom.isZero {
642+
self.webView.customBottomInset = safeInsets.bottom
643+
} else {
644+
self.webView.customBottomInset = safeInsets.bottom * (1.0 - insets.bottom / fullInsets.bottom)
645+
}
643646
// self.webView.scrollView.scrollIndicatorInsets = UIEdgeInsets(top: 0.0, left: -insets.left, bottom: 0.0, right: -insets.right)
644647
// self.webView.scrollView.horizontalScrollIndicatorInsets = UIEdgeInsets(top: 0.0, left: -insets.left, bottom: 0.0, right: -insets.right)
645648

@@ -1457,8 +1460,7 @@ final class BrowserWebContent: UIView, BrowserContent, WKNavigationDelegate, WKU
14571460
}
14581461
}
14591462

1460-
if result.isEmpty, let webViewUrl = self.webView.url {
1461-
let schemeAndHostUrl = webViewUrl.deletingPathExtension()
1463+
if result.isEmpty, let webViewUrl = self.webView.url, let schemeAndHostUrl = URL(string: "/", relativeTo: webViewUrl) {
14621464
let url = schemeAndHostUrl.appendingPathComponent("favicon.ico")
14631465
result.insert(Favicon(url: url.absoluteString, dimensions: nil))
14641466
}

submodules/ChatListUI/Sources/ChatListSearchListPaneNode.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3816,7 +3816,8 @@ final class ChatListSearchListPaneNode: ASDisplayNode, ChatListSearchPaneNode {
38163816
context: self.context,
38173817
parentController: parentController,
38183818
updatedPresentationData: nil,
3819-
peer: peer,
3819+
botPeer: peer,
3820+
chatPeer: nil,
38203821
threadId: nil,
38213822
buttonText: "",
38223823
url: "",
@@ -3840,7 +3841,8 @@ final class ChatListSearchListPaneNode: ASDisplayNode, ChatListSearchPaneNode {
38403841
context: self.context,
38413842
parentController: parentController,
38423843
updatedPresentationData: nil,
3843-
peer: peer,
3844+
botPeer: peer,
3845+
chatPeer: nil,
38443846
threadId: nil,
38453847
buttonText: "",
38463848
url: "",

submodules/Display/Source/Navigation/MinimizedContainer.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public protocol MinimizableController: ViewController {
3030
var isMinimizable: Bool { get }
3131
var minimizedIcon: UIImage? { get }
3232
var minimizedProgress: Float? { get }
33+
var isFullscreen: Bool { get }
3334

3435
func requestMinimize(topEdgeOffset: CGFloat?, initialVelocity: CGFloat?)
3536
func makeContentSnapshotView() -> UIView?
@@ -41,6 +42,10 @@ public protocol MinimizableController: ViewController {
4142
}
4243

4344
public extension MinimizableController {
45+
var isFullscreen: Bool {
46+
return false
47+
}
48+
4449
var minimizedTopEdgeOffset: CGFloat? {
4550
return nil
4651
}

submodules/LegacyComponents/Sources/TGAttachmentCarouselItemView.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,7 @@ - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPa
920920
}
921921

922922
TGPhotoEditorController *controller = [[TGPhotoEditorController alloc] initWithContext:[windowManager context] item:editableItem intent:intent adjustments:nil caption:nil screenImage:thumbnailImage availableTabs:[TGPhotoEditorController defaultTabsForAvatarIntent:!_disableStickers] selectedTab:TGPhotoEditorCropTab];
923+
controller.modalPresentationStyle = UIModalPresentationFullScreen;
923924
controller.editingContext = _editingContext;
924925
controller.stickersContext = _stickersContext;
925926
controller.dontHideStatusBar = true;

submodules/LegacyComponents/Sources/TGMediaAssetsPickerController.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPa
449449
}
450450

451451
TGPhotoEditorController *controller = [[TGPhotoEditorController alloc] initWithContext:_context item:editableItem intent:intent adjustments:nil caption:nil screenImage:thumbnailImage availableTabs:[TGPhotoEditorController defaultTabsForAvatarIntent:_intent != TGMediaAssetsControllerSetSignupProfilePhotoIntent] selectedTab:TGPhotoEditorCropTab];
452+
controller.modalPresentationStyle = UIModalPresentationFullScreen;
452453
controller.stickersContext = self.stickersContext;
453454
controller.editingContext = self.editingContext;
454455
controller.didFinishRenderingFullSizeImage = ^(UIImage *resultImage)

0 commit comments

Comments
 (0)