diff --git a/TelegramUI/ChannelInfoController.swift b/TelegramUI/ChannelInfoController.swift index 5cc819775c..b38617eddf 100644 --- a/TelegramUI/ChannelInfoController.swift +++ b/TelegramUI/ChannelInfoController.swift @@ -979,7 +979,7 @@ public func channelInfoController(context: AccountContext, peerId: PeerId) -> Vi (controller?.navigationController as? NavigationController)?.pushViewController(value) } presentControllerImpl = { [weak controller] value, presentationArguments in - controller?.present(value, in: .window(.root), with: presentationArguments) + controller?.present(value, in: .window(.root), with: presentationArguments, blockInteraction: true) } removePeerChatImpl = { [weak controller] peer, deleteGloballyIfPossible in guard let controller = controller, let navigationController = controller.navigationController as? NavigationController else { diff --git a/TelegramUI/ChatController.swift b/TelegramUI/ChatController.swift index f8994434b8..a250867bb1 100644 --- a/TelegramUI/ChatController.swift +++ b/TelegramUI/ChatController.swift @@ -811,7 +811,7 @@ public final class ChatController: TelegramController, KeyShortcutResponder, Gal } } strongSelf.chatDisplayNode.dismissInput() - strongSelf.present(shareController, in: .window(.root)) + strongSelf.present(shareController, in: .window(.root), blockInteraction: true) } }, presentController: { [weak self] controller, arguments in self?.present(controller, in: .window(.root), with: arguments) @@ -4067,7 +4067,7 @@ public final class ChatController: TelegramController, KeyShortcutResponder, Gal self.navigationActionDisposable.set((peerView.get() |> take(1) |> deliverOnMainQueue).start(next: { [weak self] peerView in - if let strongSelf = self, let peer = peerView.peers[peerView.peerId], peer.restrictionText == nil { + if let strongSelf = self, let peer = peerView.peers[peerView.peerId], peer.restrictionText == nil && !strongSelf.presentationInterfaceState.isNotAccessible { if let infoController = peerInfoController(context: strongSelf.context, peer: peer) { (strongSelf.navigationController as? NavigationController)?.pushViewController(infoController) } diff --git a/TelegramUI/ChatListItem.swift b/TelegramUI/ChatListItem.swift index 98bc6c3582..bd6879b8c5 100644 --- a/TelegramUI/ChatListItem.swift +++ b/TelegramUI/ChatListItem.swift @@ -792,7 +792,6 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { if isSecret { currentSecretIconImage = PresentationResourcesChatList.secretIcon(item.presentationData.theme) } - if isVerified { currentVerificationIconImage = PresentationResourcesChatList.verifiedIcon(item.presentationData.theme) } @@ -827,6 +826,14 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { badgeSize += badgeLayout.width + 5.0 } } + if let currentPinnedIconImage = currentPinnedIconImage { + if !badgeSize.isZero { + badgeSize += 4.0 + } else { + badgeSize += 5.0 + } + badgeSize += currentPinnedIconImage.size.width + } badgeSize = max(badgeSize, reorderInset) let (authorLayout, authorApply) = authorLayout(TextNodeLayoutArguments(attributedString: hideAuthor ? nil : authorAttributedString, backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: rawContentRect.width - badgeSize, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets(top: 2.0, left: 1.0, bottom: 2.0, right: 1.0))) @@ -1311,22 +1318,19 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { let updatedBadgeFrame = CGRect(origin: CGPoint(x: contentRect.maxX - badgeFrame.size.width, y: contentRect.maxY - badgeFrame.size.height - 2.0), size: badgeFrame.size) transition.updateFrame(node: self.badgeNode, frame: updatedBadgeFrame) - let mentionBadgeSize = self.pinnedIconNode.bounds.size - if mentionBadgeSize != CGSize.zero { + let pinnedIconSize = self.pinnedIconNode.bounds.size + if pinnedIconSize != CGSize.zero { let mentionBadgeOffset: CGFloat if updatedBadgeFrame.size.width.isZero { - mentionBadgeOffset = contentRect.maxX - mentionBadgeSize.width + mentionBadgeOffset = contentRect.maxX - pinnedIconSize.width } else { - mentionBadgeOffset = contentRect.maxX - updatedBadgeFrame.size.width - 6.0 - mentionBadgeSize.width + mentionBadgeOffset = contentRect.maxX - updatedBadgeFrame.size.width - 6.0 - pinnedIconSize.width } - let badgeBackgroundWidth = mentionBadgeSize.width - let badgeBackgroundFrame = CGRect(x: mentionBadgeOffset, y: self.pinnedIconNode.frame.origin.y, width: badgeBackgroundWidth, height: mentionBadgeSize.height) + let badgeBackgroundWidth = pinnedIconSize.width + let badgeBackgroundFrame = CGRect(x: mentionBadgeOffset, y: self.pinnedIconNode.frame.origin.y, width: badgeBackgroundWidth, height: pinnedIconSize.height) transition.updateFrame(node: self.pinnedIconNode, frame: badgeBackgroundFrame) } - -// let badgeTextFrame = self.badgeTextNode.frame -// transition.updateFrame(node: self.badgeTextNode, frame: CGRect(origin: CGPoint(x: updatedBadgeFrame.midX - badgeTextFrame.size.width / 2.0, y: badgeTextFrame.minY), size: badgeTextFrame.size)) } } diff --git a/TelegramUI/GroupInfoController.swift b/TelegramUI/GroupInfoController.swift index 51d0b77992..ce83f15341 100644 --- a/TelegramUI/GroupInfoController.swift +++ b/TelegramUI/GroupInfoController.swift @@ -2084,7 +2084,7 @@ public func groupInfoController(context: AccountContext, peerId originalPeerId: } presentControllerImpl = { [weak controller] value, presentationArguments in controller?.view.endEditing(true) - controller?.present(value, in: .window(.root), with: presentationArguments) + controller?.present(value, in: .window(.root), with: presentationArguments, blockInteraction: true) } upgradedToSupergroupImpl = { [weak controller] upgradedPeerId, f in let _ = (context.account.postbox.transaction { transaction -> Peer? in diff --git a/TelegramUI/InstantPageController.swift b/TelegramUI/InstantPageController.swift index 3402cb20f9..f572cc4be5 100644 --- a/TelegramUI/InstantPageController.swift +++ b/TelegramUI/InstantPageController.swift @@ -92,7 +92,7 @@ final class InstantPageController: ViewController { self.displayNode = InstantPageControllerNode(context: self.context, settings: self.settings, themeSettings: self.themeSettings, presentationTheme: self.presentationData.theme, strings: self.presentationData.strings, dateTimeFormat: self.presentationData.dateTimeFormat, statusBar: self.statusBar, sourcePeerType: self.sourcePeerType, getNavigationController: { [weak self] in return self?.navigationController as? NavigationController }, present: { [weak self] c, a in - self?.present(c, in: .window(.root), with: a) + self?.present(c, in: .window(.root), with: a, blockInteraction: true) }, pushController: { [weak self] c in (self?.navigationController as? NavigationController)?.pushViewController(c) }, openPeer: { [weak self] peerId in diff --git a/TelegramUI/OpenInOptions.swift b/TelegramUI/OpenInOptions.swift index a7a7973708..2ded488b2a 100644 --- a/TelegramUI/OpenInOptions.swift +++ b/TelegramUI/OpenInOptions.swift @@ -78,9 +78,9 @@ private func allOpenInOptions(context: AccountContext, item: OpenInItem) -> [Ope return .none })) - options.append(OpenInOption(application: .other(title: "Opera Mini", identifier: 363729560, scheme: "opera-http"), action: { + options.append(OpenInOption(application: .other(title: "Opera Touch", identifier: 1411869974, scheme: "touch-http"), action: { if let url = URL(string: url), var components = URLComponents(url: url, resolvingAgainstBaseURL: true) { - components.scheme = components.scheme == "https" ? "opera-https" : "opera-http" + components.scheme = components.scheme == "https" ? "touch-https" : "touch-http" if let url = components.string { return .openUrl(url: url) } diff --git a/TelegramUI/PeerMediaCollectionController.swift b/TelegramUI/PeerMediaCollectionController.swift index 8851c648e2..9058fd26a5 100644 --- a/TelegramUI/PeerMediaCollectionController.swift +++ b/TelegramUI/PeerMediaCollectionController.swift @@ -219,7 +219,17 @@ public class PeerMediaCollectionController: TelegramController { ActionSheetButtonItem(title: openText, color: .accent, action: { [weak actionSheet] in actionSheet?.dismissAnimated() if let strongSelf = self { - strongSelf.context.sharedContext.applicationBindings.openUrl(url) + if canOpenIn { + let actionSheet = OpenInActionSheetController(context: strongSelf.context, item: .url(url: url), openUrl: { [weak self] url in + if let strongSelf = self, let navigationController = strongSelf.navigationController as? NavigationController { + openExternalUrl(context: strongSelf.context, url: url, forceExternal: true, presentationData: strongSelf.presentationData, navigationController: navigationController, dismissInput: { + }) + } + }) + strongSelf.present(actionSheet, in: .window(.root)) + } else { + strongSelf.context.sharedContext.applicationBindings.openUrl(url) + } } }), ActionSheetButtonItem(title: strongSelf.presentationData.strings.ShareMenu_CopyShareLink, color: .accent, action: { [weak actionSheet] in diff --git a/TelegramUI/ShareControllerPeerGridItem.swift b/TelegramUI/ShareControllerPeerGridItem.swift index fac3eb1727..47aa3fc9d9 100644 --- a/TelegramUI/ShareControllerPeerGridItem.swift +++ b/TelegramUI/ShareControllerPeerGridItem.swift @@ -192,6 +192,6 @@ final class ShareControllerPeerGridItemNode: GridItemNode { let bounds = self.bounds self.peerNode.frame = bounds - self.onlineNode.frame = CGRect(origin: CGPoint(x: self.peerNode.frame.width - self.onlineNode.frame.width - 11.0, y: self.peerNode.frame.height - self.onlineNode.frame.height - 43.0), size: self.onlineNode.frame.size) + self.onlineNode.frame = CGRect(origin: CGPoint(x: self.peerNode.frame.width - self.onlineNode.frame.width - 13.0, y: self.peerNode.frame.height - self.onlineNode.frame.height - 45.0), size: self.onlineNode.frame.size) } } diff --git a/TelegramUI/UserInfoController.swift b/TelegramUI/UserInfoController.swift index 6677b8b993..38c8f60386 100644 --- a/TelegramUI/UserInfoController.swift +++ b/TelegramUI/UserInfoController.swift @@ -1158,7 +1158,7 @@ public func userInfoController(context: AccountContext, peerId: PeerId, mode: Us (controller?.navigationController as? NavigationController)?.pushViewController(value) } presentControllerImpl = { [weak controller] value, presentationArguments in - controller?.present(value, in: .window(.root), with: presentationArguments) + controller?.present(value, in: .window(.root), with: presentationArguments, blockInteraction: true) } dismissInputImpl = { [weak controller] in controller?.view.endEditing(true)