diff --git a/submodules/DateSelectionUI/Sources/DateSelectionActionSheetController.swift b/submodules/DateSelectionUI/Sources/DateSelectionActionSheetController.swift index cd1b21738f..f4db5b0839 100644 --- a/submodules/DateSelectionUI/Sources/DateSelectionActionSheetController.swift +++ b/submodules/DateSelectionUI/Sources/DateSelectionActionSheetController.swift @@ -105,7 +105,6 @@ private final class DateSelectionActionSheetItemNode: ActionSheetItemNode { self.pickerView = UIDatePicker() self.pickerView.timeZone = TimeZone(secondsFromGMT: 0) - self.pickerView.setValue(theme.primaryTextColor, forKey: "textColor") self.pickerView.datePickerMode = .countDownTimer self.pickerView.datePickerMode = .date self.pickerView.date = Date(timeIntervalSince1970: Double(roundDateToDays(currentValue))) @@ -121,6 +120,7 @@ private final class DateSelectionActionSheetItemNode: ActionSheetItemNode { } else { self.pickerView.maximumDate = Date(timeIntervalSince1970: Double(Int32.max - 1)) } + self.pickerView.setValue(theme.primaryTextColor, forKey: "textColor") super.init(theme: theme) diff --git a/submodules/PeerInfoUI/Sources/ChannelAdminController.swift b/submodules/PeerInfoUI/Sources/ChannelAdminController.swift index 5874c4672c..024df19477 100644 --- a/submodules/PeerInfoUI/Sources/ChannelAdminController.swift +++ b/submodules/PeerInfoUI/Sources/ChannelAdminController.swift @@ -564,11 +564,11 @@ private func rightEnabledByDefault(channelPeer: Peer, right: TelegramChatAdminRi return false } -private func areAllAdminRightsEnabled(_ flags: TelegramChatAdminRightsFlags, group: Bool) -> Bool { +private func areAllAdminRightsEnabled(_ flags: TelegramChatAdminRightsFlags, group: Bool, except: TelegramChatAdminRightsFlags) -> Bool { if group { - return TelegramChatAdminRightsFlags.groupSpecific.intersection(flags) == TelegramChatAdminRightsFlags.groupSpecific + return TelegramChatAdminRightsFlags.groupSpecific.subtracting(except).intersection(flags) == TelegramChatAdminRightsFlags.groupSpecific.subtracting(except) } else { - return TelegramChatAdminRightsFlags.broadcastSpecific.intersection(flags) == TelegramChatAdminRightsFlags.broadcastSpecific + return TelegramChatAdminRightsFlags.broadcastSpecific.subtracting(except).intersection(flags) == TelegramChatAdminRightsFlags.broadcastSpecific.subtracting(except) } } @@ -682,7 +682,7 @@ private func channelAdminControllerEntries(presentationData: PresentationData, s entries.append(.addAdminsInfo(presentationData.theme, currentRightsFlags.contains(.canAddAdmins) ? presentationData.strings.Channel_EditAdmin_PermissinAddAdminOn : presentationData.strings.Channel_EditAdmin_PermissinAddAdminOff)) } - if let admin = admin as? TelegramUser, admin.botInfo == nil && !admin.isDeleted && channel.flags.contains(.isCreator) && areAllAdminRightsEnabled(currentRightsFlags, group: isGroup) { + if let admin = admin as? TelegramUser, admin.botInfo == nil && !admin.isDeleted && channel.flags.contains(.isCreator) && areAllAdminRightsEnabled(currentRightsFlags, group: isGroup, except: .canBeAnonymous) { canTransfer = true } @@ -794,7 +794,7 @@ private func channelAdminControllerEntries(presentationData: PresentationData, s entries.append(.addAdminsInfo(presentationData.theme, currentRightsFlags.contains(.canAddAdmins) ? presentationData.strings.Channel_EditAdmin_PermissinAddAdminOn : presentationData.strings.Channel_EditAdmin_PermissinAddAdminOff)) } - if let admin = admin as? TelegramUser, case .creator = group.role, admin.botInfo == nil && !admin.isDeleted && areAllAdminRightsEnabled(currentRightsFlags, group: true) { + if let admin = admin as? TelegramUser, case .creator = group.role, admin.botInfo == nil && !admin.isDeleted && areAllAdminRightsEnabled(currentRightsFlags, group: true, except: .canBeAnonymous) { entries.append(.transfer(presentationData.theme, presentationData.strings.Group_EditAdmin_TransferOwnership)) } diff --git a/submodules/PeerInfoUI/Sources/PeerBanTimeoutController.swift b/submodules/PeerInfoUI/Sources/PeerBanTimeoutController.swift index 50c71a9558..0455560d5b 100644 --- a/submodules/PeerInfoUI/Sources/PeerBanTimeoutController.swift +++ b/submodules/PeerInfoUI/Sources/PeerBanTimeoutController.swift @@ -94,7 +94,6 @@ private final class PeerBanTimeoutActionSheetItemNode: ActionSheetItemNode { self.valueChanged = valueChanged self.pickerView = UIDatePicker() - self.pickerView.setValue(theme.primaryTextColor, forKey: "textColor") self.pickerView.datePickerMode = .countDownTimer self.pickerView.datePickerMode = .date self.pickerView.date = Date(timeIntervalSince1970: Double(roundDateToDays(currentValue))) @@ -104,6 +103,7 @@ private final class PeerBanTimeoutActionSheetItemNode: ActionSheetItemNode { if #available(iOS 13.4, *) { self.pickerView.preferredDatePickerStyle = .wheels } + self.pickerView.setValue(theme.primaryTextColor, forKey: "textColor") super.init(theme: theme) diff --git a/submodules/SettingsUI/Sources/Themes/ThemeAutoNightTimeSelectionActionSheet.swift b/submodules/SettingsUI/Sources/Themes/ThemeAutoNightTimeSelectionActionSheet.swift index 3edd0efda9..0a670a83d6 100644 --- a/submodules/SettingsUI/Sources/Themes/ThemeAutoNightTimeSelectionActionSheet.swift +++ b/submodules/SettingsUI/Sources/Themes/ThemeAutoNightTimeSelectionActionSheet.swift @@ -99,7 +99,6 @@ private final class ThemeAutoNightTimeSelectionActionSheetItemNode: ActionSheetI self.valueChanged = valueChanged self.pickerView = UIDatePicker() - self.pickerView.setValue(theme.primaryTextColor, forKey: "textColor") self.pickerView.datePickerMode = .countDownTimer self.pickerView.datePickerMode = .time self.pickerView.timeZone = TimeZone(secondsFromGMT: 0) @@ -108,6 +107,7 @@ private final class ThemeAutoNightTimeSelectionActionSheetItemNode: ActionSheetI if #available(iOS 13.4, *) { self.pickerView.preferredDatePickerStyle = .wheels } + self.pickerView.setValue(theme.primaryTextColor, forKey: "textColor") super.init(theme: theme) diff --git a/submodules/TelegramCore/Sources/MacInternalUpdater.swift b/submodules/TelegramCore/Sources/MacInternalUpdater.swift index f9d48f6746..f185d80ce8 100644 --- a/submodules/TelegramCore/Sources/MacInternalUpdater.swift +++ b/submodules/TelegramCore/Sources/MacInternalUpdater.swift @@ -26,7 +26,7 @@ public func requestUpdatesXml(account: Account, source: String) -> Signal castError(InternalUpdaterError.self) |> mapToSignal { result in switch result { - case let .channelMessages(_, _, _, apiMessages, apiChats, apiUsers): + case let .channelMessages(_, _, _, _, apiMessages, apiChats, apiUsers): if let apiMessage = apiMessages.first, let storeMessage = StoreMessage(apiMessage: apiMessage) { var peers: [PeerId: Peer] = [:] @@ -93,7 +93,7 @@ public func downloadAppUpdate(account: Account, source: String, messageId: Int32 |> castError(InternalUpdaterError.self) |> mapToSignal { messages in switch messages { - case let .channelMessages(_, _, _, apiMessages, apiChats, apiUsers): + case let .channelMessages(_, _, _, _, apiMessages, apiChats, apiUsers): var peers: [PeerId: Peer] = [:] for chat in apiChats { diff --git a/submodules/TelegramCore/Sources/ManagedLocalInputActivities.swift b/submodules/TelegramCore/Sources/ManagedLocalInputActivities.swift index f54632ced1..b8ace47668 100644 --- a/submodules/TelegramCore/Sources/ManagedLocalInputActivities.swift +++ b/submodules/TelegramCore/Sources/ManagedLocalInputActivities.swift @@ -133,8 +133,10 @@ private func requestActivity(postbox: Postbox, network: Network, accountPeerId: if let _ = peer as? TelegramUser { if let presence = transaction.getPeerPresence(peerId: peerId) as? TelegramUserPresence { switch presence.status { - case .none, .recently, .lastWeek, .lastMonth: + case .none, .lastWeek, .lastMonth: return .complete() + case .recently: + break case let .present(statusTimestamp): let timestamp = Int32(CFAbsoluteTimeGetCurrent() + NSTimeIntervalSince1970) if statusTimestamp < timestamp { diff --git a/submodules/TelegramCore/Sources/UpdatePinnedMessage.swift b/submodules/TelegramCore/Sources/UpdatePinnedMessage.swift index baa8233d92..921402b597 100644 --- a/submodules/TelegramCore/Sources/UpdatePinnedMessage.swift +++ b/submodules/TelegramCore/Sources/UpdatePinnedMessage.swift @@ -20,6 +20,7 @@ public func requestUpdatePinnedMessage(account: Account, peerId: PeerId, update: return (transaction.getPeer(peerId), transaction.getPeerCachedData(peerId: peerId)) } |> mapError { _ -> UpdatePinnedMessageError in + return .generic } |> mapToSignal { peer, cachedPeerData -> Signal in guard let peer = peer, let inputPeer = apiInputPeer(peer) else { @@ -102,6 +103,7 @@ public func requestUpdatePinnedMessage(account: Account, peerId: PeerId, update: } } |> mapError { _ -> UpdatePinnedMessageError in + return .generic } } } diff --git a/submodules/TelegramUI/Sources/ChatController.swift b/submodules/TelegramUI/Sources/ChatController.swift index 168e497d32..a1025aa0f5 100644 --- a/submodules/TelegramUI/Sources/ChatController.swift +++ b/submodules/TelegramUI/Sources/ChatController.swift @@ -746,7 +746,11 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G } }, sendCurrentMessage: { [weak self] silentPosting in if let strongSelf = self { - strongSelf.chatDisplayNode.sendCurrentMessage(silentPosting: silentPosting) + if let _ = strongSelf.presentationInterfaceState.recordedMediaPreview { + strongSelf.sendMediaRecording(silently: silentPosting) + } else { + strongSelf.chatDisplayNode.sendCurrentMessage(silentPosting: silentPosting) + } } }, sendMessage: { [weak self] text in guard let strongSelf = self, canSendMessagesToChat(strongSelf.presentationInterfaceState) else { @@ -3701,6 +3705,13 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G } } + self.chatDisplayNode.historyNode.scrolledToSomeIndex = { [weak self] in + guard let strongSelf = self else { + return + } + strongSelf.scrolledToMessageId.set(nil) + } + self.chatDisplayNode.historyNode.maxVisibleMessageIndexUpdated = { [weak self] index in if let strongSelf = self, !strongSelf.historyNavigationStack.isEmpty { strongSelf.historyNavigationStack.filterOutIndicesLessThan(index) @@ -3754,7 +3765,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G stationaryItemRange = (maxInsertedItem + 1, Int.max) } - mappedTransition = (ChatHistoryListViewTransition(historyView: transition.historyView, deleteItems: deleteItems, insertItems: insertItems, updateItems: transition.updateItems, options: options, scrollToItem: scrollToItem, stationaryItemRange: stationaryItemRange, initialData: transition.initialData, keyboardButtonsMessage: transition.keyboardButtonsMessage, cachedData: transition.cachedData, cachedDataMessages: transition.cachedDataMessages, readStateData: transition.readStateData, scrolledToIndex: transition.scrolledToIndex, peerType: transition.peerType, networkType: transition.networkType, animateIn: false, reason: transition.reason, flashIndicators: transition.flashIndicators), updateSizeAndInsets) + mappedTransition = (ChatHistoryListViewTransition(historyView: transition.historyView, deleteItems: deleteItems, insertItems: insertItems, updateItems: transition.updateItems, options: options, scrollToItem: scrollToItem, stationaryItemRange: stationaryItemRange, initialData: transition.initialData, keyboardButtonsMessage: transition.keyboardButtonsMessage, cachedData: transition.cachedData, cachedDataMessages: transition.cachedDataMessages, readStateData: transition.readStateData, scrolledToIndex: transition.scrolledToIndex, scrolledToSomeIndex: transition.scrolledToSomeIndex, peerType: transition.peerType, networkType: transition.networkType, animateIn: false, reason: transition.reason, flashIndicators: transition.flashIndicators), updateSizeAndInsets) }) if let mappedTransition = mappedTransition { @@ -4639,8 +4650,8 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G strongSelf.lockMediaRecorder() }, deleteRecordedMedia: { [weak self] in self?.deleteMediaRecording() - }, sendRecordedMedia: { [weak self] in - self?.sendMediaRecording() + }, sendRecordedMedia: { [weak self] silently in + self?.sendMediaRecording(silently: silently) }, displayRestrictedInfo: { [weak self] subject, displayType in guard let strongSelf = self else { return @@ -8271,7 +8282,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G }) } - private func sendMediaRecording() { + private func sendMediaRecording(silently: Bool) { self.chatDisplayNode.updateRecordedMediaDeleted(false) if let recordedMediaPreview = self.presentationInterfaceState.recordedMediaPreview { if let _ = self.presentationInterfaceState.slowmodeState, !self.presentationInterfaceState.isScheduledMessages { @@ -8291,7 +8302,12 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G } }) - self.sendMessages([.message(text: "", attributes: [], mediaReference: .standalone(media: TelegramMediaFile(fileId: MediaId(namespace: Namespaces.Media.LocalFile, id: arc4random64()), partialReference: nil, resource: recordedMediaPreview.resource, previewRepresentations: [], videoThumbnails: [], immediateThumbnailData: nil, mimeType: "audio/ogg", size: Int(recordedMediaPreview.fileSize), attributes: [.Audio(isVoice: true, duration: Int(recordedMediaPreview.duration), title: nil, performer: nil, waveform: waveformBuffer)])), replyToMessageId: self.presentationInterfaceState.interfaceState.replyMessageId, localGroupingKey: nil)]) + var attributes: [MessageAttribute] = [] + if silently { + attributes.append(NotificationInfoMessageAttribute(flags: .muted)) + } + + self.sendMessages([.message(text: "", attributes: attributes, mediaReference: .standalone(media: TelegramMediaFile(fileId: MediaId(namespace: Namespaces.Media.LocalFile, id: arc4random64()), partialReference: nil, resource: recordedMediaPreview.resource, previewRepresentations: [], videoThumbnails: [], immediateThumbnailData: nil, mimeType: "audio/ogg", size: Int(recordedMediaPreview.fileSize), attributes: [.Audio(isVoice: true, duration: Int(recordedMediaPreview.duration), title: nil, performer: nil, waveform: waveformBuffer)])), replyToMessageId: self.presentationInterfaceState.interfaceState.replyMessageId, localGroupingKey: nil)]) } } diff --git a/submodules/TelegramUI/Sources/ChatDateSelectionSheet.swift b/submodules/TelegramUI/Sources/ChatDateSelectionSheet.swift index 06d77d87a5..7e646caf52 100644 --- a/submodules/TelegramUI/Sources/ChatDateSelectionSheet.swift +++ b/submodules/TelegramUI/Sources/ChatDateSelectionSheet.swift @@ -84,7 +84,6 @@ private final class ChatDateSelectorItemNode: ActionSheetItemNode { self.valueChanged = valueChanged self.pickerView = UIDatePicker() - self.pickerView.setValue(theme.primaryTextColor, forKey: "textColor") self.pickerView.datePickerMode = .countDownTimer self.pickerView.datePickerMode = .date self.pickerView.locale = Locale(identifier: strings.baseLanguageCode) @@ -96,6 +95,8 @@ private final class ChatDateSelectorItemNode: ActionSheetItemNode { self.pickerView.preferredDatePickerStyle = .wheels } + self.pickerView.setValue(theme.primaryTextColor, forKey: "textColor") + super.init(theme: theme) self.view.addSubview(self.pickerView) diff --git a/submodules/TelegramUI/Sources/ChatHistoryListNode.swift b/submodules/TelegramUI/Sources/ChatHistoryListNode.swift index f0669a5294..0cdcd23edb 100644 --- a/submodules/TelegramUI/Sources/ChatHistoryListNode.swift +++ b/submodules/TelegramUI/Sources/ChatHistoryListNode.swift @@ -165,6 +165,7 @@ struct ChatHistoryViewTransition { let cachedDataMessages: [MessageId: Message]? let readStateData: [PeerId: ChatHistoryCombinedInitialReadStateData]? let scrolledToIndex: MessageHistoryAnchorIndex? + let scrolledToSomeIndex: Bool let animateIn: Bool let reason: ChatHistoryViewTransitionReason let flashIndicators: Bool @@ -184,6 +185,7 @@ struct ChatHistoryListViewTransition { let cachedDataMessages: [MessageId: Message]? let readStateData: [PeerId: ChatHistoryCombinedInitialReadStateData]? let scrolledToIndex: MessageHistoryAnchorIndex? + let scrolledToSomeIndex: Bool let peerType: MediaAutoDownloadPeerType let networkType: MediaAutoDownloadNetworkType let animateIn: Bool @@ -345,7 +347,7 @@ private func mappedUpdateEntries(context: AccountContext, chatLocation: ChatLoca } private func mappedChatHistoryViewListTransition(context: AccountContext, chatLocation: ChatLocation, associatedData: ChatMessageItemAssociatedData, controllerInteraction: ChatControllerInteraction, mode: ChatHistoryListMode, lastHeaderId: Int64, transition: ChatHistoryViewTransition) -> ChatHistoryListViewTransition { - return ChatHistoryListViewTransition(historyView: transition.historyView, deleteItems: transition.deleteItems, insertItems: mappedInsertEntries(context: context, chatLocation: chatLocation, associatedData: associatedData, controllerInteraction: controllerInteraction, mode: mode, lastHeaderId: lastHeaderId, entries: transition.insertEntries), updateItems: mappedUpdateEntries(context: context, chatLocation: chatLocation, associatedData: associatedData, controllerInteraction: controllerInteraction, mode: mode, lastHeaderId: lastHeaderId, entries: transition.updateEntries), options: transition.options, scrollToItem: transition.scrollToItem, stationaryItemRange: transition.stationaryItemRange, initialData: transition.initialData, keyboardButtonsMessage: transition.keyboardButtonsMessage, cachedData: transition.cachedData, cachedDataMessages: transition.cachedDataMessages, readStateData: transition.readStateData, scrolledToIndex: transition.scrolledToIndex, peerType: associatedData.automaticDownloadPeerType, networkType: associatedData.automaticDownloadNetworkType, animateIn: transition.animateIn, reason: transition.reason, flashIndicators: transition.flashIndicators) + return ChatHistoryListViewTransition(historyView: transition.historyView, deleteItems: transition.deleteItems, insertItems: mappedInsertEntries(context: context, chatLocation: chatLocation, associatedData: associatedData, controllerInteraction: controllerInteraction, mode: mode, lastHeaderId: lastHeaderId, entries: transition.insertEntries), updateItems: mappedUpdateEntries(context: context, chatLocation: chatLocation, associatedData: associatedData, controllerInteraction: controllerInteraction, mode: mode, lastHeaderId: lastHeaderId, entries: transition.updateEntries), options: transition.options, scrollToItem: transition.scrollToItem, stationaryItemRange: transition.stationaryItemRange, initialData: transition.initialData, keyboardButtonsMessage: transition.keyboardButtonsMessage, cachedData: transition.cachedData, cachedDataMessages: transition.cachedDataMessages, readStateData: transition.readStateData, scrolledToIndex: transition.scrolledToIndex, scrolledToSomeIndex: transition.scrolledToSomeIndex, peerType: associatedData.automaticDownloadPeerType, networkType: associatedData.automaticDownloadNetworkType, animateIn: transition.animateIn, reason: transition.reason, flashIndicators: transition.flashIndicators) } private final class ChatHistoryTransactionOpaqueState { @@ -526,6 +528,7 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode { var maxVisibleMessageIndexUpdated: ((MessageIndex) -> Void)? var scrolledToIndex: ((MessageHistoryAnchorIndex) -> Void)? + var scrolledToSomeIndex: (() -> Void)? var beganDragging: (() -> Void)? private let hasVisiblePlayableItemNodesPromise = ValuePromise(false, ignoreRepeated: true) @@ -1499,10 +1502,12 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode { } public func scrollToStartOfHistory() { + self.beganDragging?() self.chatHistoryLocationValue = ChatHistoryLocationInput(content: .Scroll(index: .lowerBound, anchorIndex: .lowerBound, sourceIndex: .upperBound, scrollPosition: .bottom(0.0), animated: true, highlight: false), id: self.takeNextHistoryLocationId()) } public func scrollToEndOfHistory() { + self.beganDragging?() switch self.visibleContentOffset() { case .known(0.0): break @@ -1775,6 +1780,8 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode { if let strongSelf = self { strongSelf.scrolledToIndex?(scrolledToIndex) } + } else if transition.scrolledToSomeIndex { + self?.scrolledToSomeIndex?() } strongSelf.hasActiveTransition = false diff --git a/submodules/TelegramUI/Sources/ChatPanelInterfaceInteraction.swift b/submodules/TelegramUI/Sources/ChatPanelInterfaceInteraction.swift index 5e9a6ef85c..ebd3ed3e57 100644 --- a/submodules/TelegramUI/Sources/ChatPanelInterfaceInteraction.swift +++ b/submodules/TelegramUI/Sources/ChatPanelInterfaceInteraction.swift @@ -87,7 +87,7 @@ final class ChatPanelInterfaceInteraction { let stopMediaRecording: () -> Void let lockMediaRecording: () -> Void let deleteRecordedMedia: () -> Void - let sendRecordedMedia: () -> Void + let sendRecordedMedia: (Bool) -> Void let displayRestrictedInfo: (ChatPanelRestrictionInfoSubject, ChatPanelRestrictionInfoDisplayType) -> Void let displayVideoUnmuteTip: (CGPoint?) -> Void let switchMediaRecordingMode: () -> Void @@ -163,7 +163,7 @@ final class ChatPanelInterfaceInteraction { stopMediaRecording: @escaping () -> Void, lockMediaRecording: @escaping () -> Void, deleteRecordedMedia: @escaping () -> Void, - sendRecordedMedia: @escaping () -> Void, + sendRecordedMedia: @escaping (Bool) -> Void, displayRestrictedInfo: @escaping (ChatPanelRestrictionInfoSubject, ChatPanelRestrictionInfoDisplayType) -> Void, displayVideoUnmuteTip: @escaping (CGPoint?) -> Void, switchMediaRecordingMode: @escaping () -> Void, diff --git a/submodules/TelegramUI/Sources/ChatRecentActionsController.swift b/submodules/TelegramUI/Sources/ChatRecentActionsController.swift index 7a35c46b71..f6c30c969e 100644 --- a/submodules/TelegramUI/Sources/ChatRecentActionsController.swift +++ b/submodules/TelegramUI/Sources/ChatRecentActionsController.swift @@ -91,7 +91,7 @@ final class ChatRecentActionsController: TelegramBaseController { }, stopMediaRecording: { }, lockMediaRecording: { }, deleteRecordedMedia: { - }, sendRecordedMedia: { + }, sendRecordedMedia: { _ in }, displayRestrictedInfo: { _, _ in }, displayVideoUnmuteTip: { _ in }, switchMediaRecordingMode: { diff --git a/submodules/TelegramUI/Sources/ChatRecordingPreviewInputPanelNode.swift b/submodules/TelegramUI/Sources/ChatRecordingPreviewInputPanelNode.swift index c5f753bf36..157bbab950 100644 --- a/submodules/TelegramUI/Sources/ChatRecordingPreviewInputPanelNode.swift +++ b/submodules/TelegramUI/Sources/ChatRecordingPreviewInputPanelNode.swift @@ -291,7 +291,7 @@ final class ChatRecordingPreviewInputPanelNode: ChatInputPanelNode { } @objc func sendPressed() { - self.interfaceInteraction?.sendRecordedMedia() + self.interfaceInteraction?.sendRecordedMedia(false) } @objc func waveformPressed() { diff --git a/submodules/TelegramUI/Sources/ChatScheduleTimeControllerNode.swift b/submodules/TelegramUI/Sources/ChatScheduleTimeControllerNode.swift index b2520fa49c..fcf97e0b49 100644 --- a/submodules/TelegramUI/Sources/ChatScheduleTimeControllerNode.swift +++ b/submodules/TelegramUI/Sources/ChatScheduleTimeControllerNode.swift @@ -180,7 +180,6 @@ class ChatScheduleTimeControllerNode: ViewControllerTracingNode, UIScrollViewDel let pickerView = UIDatePicker() pickerView.timeZone = TimeZone(secondsFromGMT: 0) - pickerView.setValue(textColor, forKey: "textColor") pickerView.datePickerMode = .countDownTimer pickerView.datePickerMode = .dateAndTime pickerView.locale = Locale.current @@ -191,6 +190,7 @@ class ChatScheduleTimeControllerNode: ViewControllerTracingNode, UIScrollViewDel if #available(iOS 13.4, *) { pickerView.preferredDatePickerStyle = .wheels } + pickerView.setValue(textColor, forKey: "textColor") self.pickerView = pickerView self.updateMinimumDate(currentTime: currentTime) diff --git a/submodules/TelegramUI/Sources/PeerInfo/PeerInfoScreen.swift b/submodules/TelegramUI/Sources/PeerInfo/PeerInfoScreen.swift index f3470f6981..7ef66e7c6e 100644 --- a/submodules/TelegramUI/Sources/PeerInfo/PeerInfoScreen.swift +++ b/submodules/TelegramUI/Sources/PeerInfo/PeerInfoScreen.swift @@ -397,7 +397,7 @@ final class PeerInfoSelectionPanelNode: ASDisplayNode { }, stopMediaRecording: { }, lockMediaRecording: { }, deleteRecordedMedia: { - }, sendRecordedMedia: { + }, sendRecordedMedia: { _ in }, displayRestrictedInfo: { _, _ in }, displayVideoUnmuteTip: { _ in }, switchMediaRecordingMode: { @@ -3087,7 +3087,7 @@ private final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewD guard let strongSelf = self else { return } - if let currentPeerId = currentPeerId { + if false, let currentPeerId = currentPeerId { if let navigationController = (strongSelf.controller?.navigationController as? NavigationController) { strongSelf.context.sharedContext.navigateToChatController(NavigateToChatControllerParams(navigationController: navigationController, context: strongSelf.context, chatLocation: .peer(currentPeerId))) } diff --git a/submodules/TelegramUI/Sources/PreparedChatHistoryViewTransition.swift b/submodules/TelegramUI/Sources/PreparedChatHistoryViewTransition.swift index cdc8293c66..2b11046ca0 100644 --- a/submodules/TelegramUI/Sources/PreparedChatHistoryViewTransition.swift +++ b/submodules/TelegramUI/Sources/PreparedChatHistoryViewTransition.swift @@ -89,6 +89,7 @@ func preparedChatHistoryViewTransition(from fromView: ChatHistoryView?, to toVie } var scrolledToIndex: MessageHistoryAnchorIndex? + var scrolledToSomeIndex = false if let scrollPosition = scrollPosition { switch scrollPosition { @@ -160,6 +161,7 @@ func preparedChatHistoryViewTransition(from fromView: ChatHistoryView?, to toVie var index = 0 for entry in toView.filteredEntries.reversed() { if !scrollIndex.isLess(than: entry.index) { + scrolledToSomeIndex = true scrollToItem = ListViewScrollToItem(index: index, position: position, animated: animated, curve: .Default(duration: nil), directionHint: directionHint) break } @@ -173,5 +175,5 @@ func preparedChatHistoryViewTransition(from fromView: ChatHistoryView?, to toVie options.insert(.Synchronous) } - return ChatHistoryViewTransition(historyView: toView, deleteItems: adjustedDeleteIndices, insertEntries: adjustedIndicesAndItems, updateEntries: adjustedUpdateItems, options: options, scrollToItem: scrollToItem, stationaryItemRange: stationaryItemRange, initialData: initialData, keyboardButtonsMessage: keyboardButtonsMessage, cachedData: cachedData, cachedDataMessages: cachedDataMessages, readStateData: readStateData, scrolledToIndex: scrolledToIndex, animateIn: animateIn, reason: reason, flashIndicators: flashIndicators) + return ChatHistoryViewTransition(historyView: toView, deleteItems: adjustedDeleteIndices, insertEntries: adjustedIndicesAndItems, updateEntries: adjustedUpdateItems, options: options, scrollToItem: scrollToItem, stationaryItemRange: stationaryItemRange, initialData: initialData, keyboardButtonsMessage: keyboardButtonsMessage, cachedData: cachedData, cachedDataMessages: cachedDataMessages, readStateData: readStateData, scrolledToIndex: scrolledToIndex, scrolledToSomeIndex: scrolledToSomeIndex || scrolledToIndex != nil, animateIn: animateIn, reason: reason, flashIndicators: flashIndicators) }