mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-15 21:45:19 +00:00
Forwarding fixes
This commit is contained in:
parent
c341b1c449
commit
eccea93186
@ -2651,14 +2651,11 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
|
||||
}
|
||||
|
||||
private func readAllInFilter(id: Int32) {
|
||||
guard case let .chatList(groupId) = self.chatListDisplayNode.effectiveContainerNode.location else {
|
||||
return
|
||||
}
|
||||
for filter in self.chatListDisplayNode.mainContainerNode.availableFilters {
|
||||
if case let .filter(filter) = filter, case let .filter(filterId, _, _, data) = filter, filterId == id {
|
||||
let filterPredicate = chatListFilterPredicate(filter: data)
|
||||
var markItems: [(groupId: EngineChatList.Group, filterPredicate: ChatListFilterPredicate?)] = []
|
||||
markItems.append((groupId, filterPredicate))
|
||||
markItems.append((.root, filterPredicate))
|
||||
for additionalGroupId in filterPredicate.includeAdditionalPeerGroupIds {
|
||||
markItems.append((EngineChatList.Group(additionalGroupId), filterPredicate))
|
||||
}
|
||||
|
@ -170,13 +170,13 @@ private enum ChatListRecentEntry: Comparable, Identifiable {
|
||||
status = .custom(string: strings.GroupInfo_ParticipantCount(Int32(group.participantCount)), multiline: false, isActive: false, icon: nil)
|
||||
} else if case let .channel(channel) = primaryPeer {
|
||||
if case .group = channel.info {
|
||||
if let count = peer.subpeerSummary?.count {
|
||||
if let count = peer.subpeerSummary?.count, count > 0 {
|
||||
status = .custom(string: strings.GroupInfo_ParticipantCount(Int32(count)), multiline: false, isActive: false, icon: nil)
|
||||
} else {
|
||||
status = .custom(string: strings.Group_Status, multiline: false, isActive: false, icon: nil)
|
||||
}
|
||||
} else {
|
||||
if let count = peer.subpeerSummary?.count {
|
||||
if let count = peer.subpeerSummary?.count, count > 0 {
|
||||
status = .custom(string: strings.Conversation_StatusSubscribers(Int32(count)), multiline: false, isActive: false, icon: nil)
|
||||
} else {
|
||||
status = .custom(string: strings.Channel_Status, multiline: false, isActive: false, icon: nil)
|
||||
|
@ -408,8 +408,10 @@ public protocol CustomViewControllerNavigationDataSummary: AnyObject {
|
||||
|
||||
self.navigationBarOrigin = navigationBarFrame.origin.y
|
||||
|
||||
let isLandscape = layout.size.width > layout.size.height
|
||||
|
||||
var isLandscape = layout.size.width > layout.size.height
|
||||
if case .regular = layout.metrics.widthClass {
|
||||
isLandscape = false
|
||||
}
|
||||
if let navigationBar = self.navigationBar {
|
||||
if let contentNode = navigationBar.contentNode, case .expansion = contentNode.mode, !self.displayNavigationBar {
|
||||
navigationBarFrame.origin.y -= navigationLayout.defaultContentHeight
|
||||
@ -420,6 +422,7 @@ public protocol CustomViewControllerNavigationDataSummary: AnyObject {
|
||||
navigationBarFrame.size.height += NavigationBar.defaultSecondaryContentHeight
|
||||
//navigationBarFrame.origin.y += NavigationBar.defaultSecondaryContentHeight
|
||||
}
|
||||
|
||||
navigationBar.updateLayout(size: navigationBarFrame.size, defaultHeight: navigationLayout.defaultContentHeight, additionalTopHeight: statusBarHeight, additionalContentHeight: self.additionalNavigationBarHeight, additionalBackgroundHeight: additionalBackgroundHeight, leftInset: layout.safeInsets.left, rightInset: layout.safeInsets.right, appearsHidden: !self.displayNavigationBar, isLandscape: isLandscape, transition: transition)
|
||||
if !transition.isAnimated {
|
||||
navigationBar.layer.removeAnimation(forKey: "bounds")
|
||||
|
@ -8,7 +8,7 @@ import GZip
|
||||
import AppBundle
|
||||
import LegacyComponents
|
||||
|
||||
private let sceneVersion: Int = 3
|
||||
private let sceneVersion: Int = 4
|
||||
|
||||
private func deg2rad(_ number: Float) -> Float {
|
||||
return number * .pi / 180
|
||||
|
@ -103,7 +103,7 @@ final class TabBarControllerNode: ASDisplayNode {
|
||||
transition.updateFrame(node: toolbarNode, frame: tabBarFrame)
|
||||
toolbarNode.updateLayout(size: tabBarFrame.size, leftInset: layout.safeInsets.left, rightInset: layout.safeInsets.right, additionalSideInsets: layout.additionalInsets, bottomInset: bottomInset, toolbar: toolbar, transition: transition)
|
||||
} else {
|
||||
let toolbarNode = ToolbarNode(theme: ToolbarTheme(tabBarTheme: self.theme), left: { [weak self] in
|
||||
let toolbarNode = ToolbarNode(theme: ToolbarTheme(tabBarTheme: self.theme), displaySeparator: true, left: { [weak self] in
|
||||
self?.toolbarActionSelected(.left)
|
||||
}, right: { [weak self] in
|
||||
self?.toolbarActionSelected(.right)
|
||||
|
@ -527,7 +527,7 @@ public final class MediaNavigationAccessoryHeaderNode: ASDisplayNode, UIScrollVi
|
||||
return speedList
|
||||
}
|
||||
|
||||
private func contextMenuSpeedItems(scheduleTooltip: @escaping (MediaNavigationAccessoryPanel.ChangeType) -> Void) -> Signal<ContextController.Items, NoError> {
|
||||
private func contextMenuSpeedItems(scheduleTooltip: @escaping (MediaNavigationAccessoryPanel.ChangeType?) -> Void) -> Signal<ContextController.Items, NoError> {
|
||||
var presetItems: [ContextMenuItem] = []
|
||||
|
||||
let previousValue = self.playbackBaseRate?.doubleValue ?? 1.0
|
||||
@ -548,6 +548,7 @@ public final class MediaNavigationAccessoryHeaderNode: ASDisplayNode, UIScrollVi
|
||||
return nil
|
||||
}
|
||||
}, action: { [weak self] _, f in
|
||||
scheduleTooltip(nil)
|
||||
f(.default)
|
||||
|
||||
self?.setRate?(rate, .preset)
|
||||
|
@ -1030,7 +1030,7 @@ final class OverlayPlayerControlsNode: ASDisplayNode {
|
||||
return speedList
|
||||
}
|
||||
|
||||
private func contextMenuSpeedItems(scheduleTooltip: @escaping (MediaNavigationAccessoryPanel.ChangeType) -> Void) -> Signal<ContextController.Items, NoError> {
|
||||
private func contextMenuSpeedItems(scheduleTooltip: @escaping (MediaNavigationAccessoryPanel.ChangeType?) -> Void) -> Signal<ContextController.Items, NoError> {
|
||||
var presetItems: [ContextMenuItem] = []
|
||||
|
||||
let previousValue = self.currentRate?.doubleValue ?? 1.0
|
||||
@ -1051,6 +1051,7 @@ final class OverlayPlayerControlsNode: ASDisplayNode {
|
||||
return nil
|
||||
}
|
||||
}, action: { [weak self] _, f in
|
||||
scheduleTooltip(nil)
|
||||
f(.default)
|
||||
|
||||
self?.control?(.setBaseRate(rate))
|
||||
|
@ -262,7 +262,7 @@ final class PeerSelectionControllerNode: ASDisplayNode {
|
||||
strongSelf.contentOffsetChanged?(offset)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
self.mainContainerNode?.contentOffsetChanged = { [weak self] offset in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
@ -569,10 +569,19 @@ final class PeerSelectionControllerNode: ASDisplayNode {
|
||||
} else {
|
||||
var selectedPeerIds: [PeerId] = []
|
||||
var selectedPeerMap: [PeerId: Peer] = [:]
|
||||
strongSelf.chatListNode?.updateState { state in
|
||||
selectedPeerIds = Array(state.selectedPeerIds)
|
||||
selectedPeerMap = state.selectedPeerMap.mapValues({ $0._asPeer() })
|
||||
return state
|
||||
if let mainContainerNode = strongSelf.mainContainerNode {
|
||||
mainContainerNode.currentItemNode.updateState { state in
|
||||
selectedPeerIds = Array(state.selectedPeerIds)
|
||||
selectedPeerMap = state.selectedPeerMap.mapValues({ $0._asPeer() })
|
||||
return state
|
||||
}
|
||||
}
|
||||
if let chatListNode = strongSelf.chatListNode {
|
||||
chatListNode.updateState { state in
|
||||
selectedPeerIds = Array(state.selectedPeerIds)
|
||||
selectedPeerMap = state.selectedPeerMap.mapValues({ $0._asPeer() })
|
||||
return state
|
||||
}
|
||||
}
|
||||
if !selectedPeerIds.isEmpty {
|
||||
var selectedPeers: [Peer] = []
|
||||
@ -598,10 +607,21 @@ final class PeerSelectionControllerNode: ASDisplayNode {
|
||||
return ContactListNodeGroupSelectionState()
|
||||
})
|
||||
} else {
|
||||
self.chatListNode?.updateState { state in
|
||||
var state = state
|
||||
state.editing = true
|
||||
return state
|
||||
if let mainContainerNode = self.mainContainerNode {
|
||||
mainContainerNode.currentItemNode.selectionCountChanged = { [weak self] count in
|
||||
self?.textInputPanelNode?.updateSendButtonEnabled(count > 0, animated: true)
|
||||
}
|
||||
mainContainerNode.currentItemNode.updateState({ state in
|
||||
var state = state
|
||||
state.editing = true
|
||||
return state
|
||||
})
|
||||
} else if let chatListNode = self.chatListNode {
|
||||
chatListNode.updateState { state in
|
||||
var state = state
|
||||
state.editing = true
|
||||
return state
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -691,7 +711,7 @@ final class PeerSelectionControllerNode: ASDisplayNode {
|
||||
}
|
||||
|
||||
insets.top += navigationBarHeight
|
||||
insets.bottom = max(insets.bottom, cleanInsets.bottom + 44.0)
|
||||
insets.bottom = max(insets.bottom, toolbarHeight)
|
||||
insets.left += layout.safeInsets.left
|
||||
insets.right += layout.safeInsets.right
|
||||
|
||||
@ -829,9 +849,7 @@ final class PeerSelectionControllerNode: ASDisplayNode {
|
||||
contactListNode.bounds = CGRect(x: 0.0, y: 0.0, width: layout.size.width, height: layout.size.height)
|
||||
contactListNode.position = CGPoint(x: layout.size.width / 2.0, y: layout.size.height / 2.0)
|
||||
|
||||
let contactsInsets = insets
|
||||
|
||||
contactListNode.containerLayoutUpdated(ContainerViewLayout(size: layout.size, metrics: layout.metrics, deviceMetrics: layout.deviceMetrics, intrinsicInsets: contactsInsets, safeInsets: layout.safeInsets, additionalInsets: layout.additionalInsets, statusBarHeight: layout.statusBarHeight, inputHeight: layout.inputHeight, inputHeightIsInteractivellyChanging: layout.inputHeightIsInteractivellyChanging, inVoiceOver: layout.inVoiceOver), headerInsets: headerInsets, transition: transition)
|
||||
contactListNode.containerLayoutUpdated(ContainerViewLayout(size: layout.size, metrics: layout.metrics, deviceMetrics: layout.deviceMetrics, intrinsicInsets: insets, safeInsets: layout.safeInsets, additionalInsets: layout.additionalInsets, statusBarHeight: layout.statusBarHeight, inputHeight: layout.inputHeight, inputHeightIsInteractivellyChanging: layout.inputHeightIsInteractivellyChanging, inVoiceOver: layout.inVoiceOver), headerInsets: headerInsets, transition: transition)
|
||||
}
|
||||
|
||||
if let searchDisplayController = self.searchDisplayController {
|
||||
|
Loading…
x
Reference in New Issue
Block a user