diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dcf2761983..243257fc2f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ on: jobs: build: - runs-on: macos-10.15 + runs-on: macos-11 steps: - uses: actions/checkout@v2 @@ -17,7 +17,7 @@ jobs: fetch-depth: '0' - name: Set active Xcode path - run: sudo xcode-select -s /Applications/Xcode_12.4.app/Contents/Developer + run: sudo xcode-select -s /Applications/Xcode_12.5.1.app/Contents/Developer - name: Create canonical source directory run: | diff --git a/submodules/LegacyComponents/BUILD b/submodules/LegacyComponents/BUILD index 16ddc7c99f..afe189ca32 100644 --- a/submodules/LegacyComponents/BUILD +++ b/submodules/LegacyComponents/BUILD @@ -30,7 +30,7 @@ objc_library( ]), copts = [ "-I{}/PublicHeaders/LegacyComponents".format(package_name()), - "-Werror", + #"-Werror", ], includes = [ "PublicHeaders", diff --git a/submodules/LegacyComponents/Sources/TGPhotoEditorSliderView.m b/submodules/LegacyComponents/Sources/TGPhotoEditorSliderView.m index acfe8a1e31..07a2a2e7f7 100644 --- a/submodules/LegacyComponents/Sources/TGPhotoEditorSliderView.m +++ b/submodules/LegacyComponents/Sources/TGPhotoEditorSliderView.m @@ -322,7 +322,7 @@ const CGFloat TGPhotoEditorSliderViewInternalMargin = 7.0f; #pragma mark - Properties -- (bool)isTracking +- (BOOL)isTracking { return _knobView.highlighted; } diff --git a/submodules/LegacyComponents/Sources/UICollectionView+TGTransitioning.m b/submodules/LegacyComponents/Sources/UICollectionView+TGTransitioning.m index e78bc4e41a..863ef22012 100755 --- a/submodules/LegacyComponents/Sources/UICollectionView+TGTransitioning.m +++ b/submodules/LegacyComponents/Sources/UICollectionView+TGTransitioning.m @@ -6,7 +6,7 @@ @implementation UICollectionView (TGTransitioning) -- (BOOL)isTransitionInProgress +- (bool)isTransitionInProgress { return ([self tg_transitionData] != nil); } diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Peers/TelegramEnginePeers.swift b/submodules/TelegramCore/Sources/TelegramEngine/Peers/TelegramEnginePeers.swift index 1a1336dc2e..17e018ff02 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Peers/TelegramEnginePeers.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Peers/TelegramEnginePeers.swift @@ -549,8 +549,11 @@ public extension TelegramEngine { } } - guard let peerGroupId = transaction.getPeerChatListIndex(peerId)?.0 else { - return nil + let peerGroupId: PeerGroupId + if let peerGroupIdValue = transaction.getPeerChatListIndex(peerId)?.0 { + peerGroupId = peerGroupIdValue + } else { + peerGroupId = .root } if let filterId = chatListFilterId { diff --git a/submodules/TelegramUI/Sources/ChatController.swift b/submodules/TelegramUI/Sources/ChatController.swift index 4872960ca1..1f02ed52f8 100644 --- a/submodules/TelegramUI/Sources/ChatController.swift +++ b/submodules/TelegramUI/Sources/ChatController.swift @@ -1283,18 +1283,35 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G strongSelf.chatDisplayNode.dismissInput() strongSelf.effectiveNavigationController?.pushViewController(GameController(context: strongSelf.context, url: url, message: message)) } + + var botPeer: TelegramUser? + for attribute in message.attributes { + if let attribute = attribute as? InlineBotMessageAttribute { + if let peerId = attribute.peerId { + botPeer = message.peers[peerId] as? TelegramUser + } + } + } + if botPeer == nil { + if let peer = message.author as? TelegramUser, peer.botInfo != nil { + botPeer = peer + } else if let peer = message.peers[message.id.peerId] as? TelegramUser, peer.botInfo != nil { + botPeer = peer + } + } - if let botPeer = message.author as? TelegramUser, botPeer.flags.contains(.isVerified) { + if let botPeer = botPeer, botPeer.flags.contains(.isVerified) { openBot() - } else { - let _ = (ApplicationSpecificNotice.getBotGameNotice(accountManager: strongSelf.context.sharedContext.accountManager, peerId: message.id.peerId) + } else if let botPeer = botPeer { + let _ = (ApplicationSpecificNotice.getBotGameNotice(accountManager: strongSelf.context.sharedContext.accountManager, peerId: botPeer.id) |> deliverOnMainQueue).start(next: { value in guard let strongSelf = self else { return } + if value { openBot() - } else if let botPeer = message.author as? TelegramUser { + } else { strongSelf.present(textAlertController(context: strongSelf.context, title: nil, text: strongSelf.presentationData.strings.Conversation_BotInteractiveUrlAlert(botPeer.displayTitle(strings: strongSelf.presentationData.strings, displayOrder: strongSelf.presentationData.nameDisplayOrder)).string, actions: [TextAlertAction(type: .genericAction, title: strongSelf.presentationData.strings.Common_Cancel, action: { }), TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: { if let strongSelf = self { let _ = ApplicationSpecificNotice.setBotGameNotice(accountManager: strongSelf.context.sharedContext.accountManager, peerId: botPeer.id).start() diff --git a/submodules/TelegramUI/Sources/ChatHistoryListNode.swift b/submodules/TelegramUI/Sources/ChatHistoryListNode.swift index 23cc9029fd..fe988e7270 100644 --- a/submodules/TelegramUI/Sources/ChatHistoryListNode.swift +++ b/submodules/TelegramUI/Sources/ChatHistoryListNode.swift @@ -1259,7 +1259,7 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode { if self.freezeOverscrollControl { return } - if let offset = offset, offset < 0.0, self.offerNextChannelToRead, let chatControllerNode = self.controllerInteraction.chatControllerNode() as? ChatControllerNode, chatControllerNode.shouldAllowOverscrollActions { + if let offset = offset, offset < -0.1, self.offerNextChannelToRead, let chatControllerNode = self.controllerInteraction.chatControllerNode() as? ChatControllerNode, chatControllerNode.shouldAllowOverscrollActions { let overscrollView: ComponentHostView if let current = self.overscrollView { overscrollView = current @@ -1271,22 +1271,24 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode { } let expandDistance = max(-offset - 12.0, 0.0) - let expandProgress: CGFloat = min(1.0, expandDistance / 90.0) + let expandProgress: CGFloat = min(1.0, expandDistance / 94.0) - if let _ = nextChannelToRead { - let previousType = self.currentOverscrollExpandProgress >= 0.99 - let currentType = expandProgress >= 0.99 + let previousType = self.currentOverscrollExpandProgress >= 1.0 + let currentType = expandProgress >= 1.0 - if previousType != currentType { - if self.feedback == nil { - self.feedback = HapticFeedback() - } - self.feedback?.tap() + if previousType != currentType { + if self.feedback == nil { + self.feedback = HapticFeedback() + } + if let _ = nextChannelToRead { + self.feedback?.tap() + } else { + self.feedback?.success() } - - self.currentOverscrollExpandProgress = expandProgress } + self.currentOverscrollExpandProgress = expandProgress + if let nextChannelToRead = self.nextChannelToRead { let swipeText: (String, [(Int, NSRange)]) let releaseText: (String, [(Int, NSRange)]) @@ -1307,7 +1309,7 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode { if expandProgress < 0.1 { chatControllerNode.setChatInputPanelOverscrollNode(overscrollNode: nil) - } else if expandProgress >= 0.99 { + } else if expandProgress >= 1.0 { if chatControllerNode.inputPanelOverscrollNode?.text.0 != releaseText.0 { chatControllerNode.setChatInputPanelOverscrollNode(overscrollNode: ChatInputPanelOverscrollNode(text: releaseText, color: self.currentPresentationData.theme.theme.rootController.navigationBar.secondaryTextColor, priority: 1)) } diff --git a/submodules/TgVoipWebrtc/tgcalls b/submodules/TgVoipWebrtc/tgcalls index b5a053d60a..dc8c87e75b 160000 --- a/submodules/TgVoipWebrtc/tgcalls +++ b/submodules/TgVoipWebrtc/tgcalls @@ -1 +1 @@ -Subproject commit b5a053d60ab96a2f7857135adef4f1a9e8cfe775 +Subproject commit dc8c87e75bb88acb51dfdd781db2f8bcf1fb7433 diff --git a/versions.json b/versions.json index 55a2b9955f..b983cff018 100644 --- a/versions.json +++ b/versions.json @@ -1,5 +1,5 @@ { - "app": "7.9.1", + "app": "8.0", "bazel": "4.0.0", "xcode": "12.5.1" }