mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +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) {
|
private func readAllInFilter(id: Int32) {
|
||||||
guard case let .chatList(groupId) = self.chatListDisplayNode.effectiveContainerNode.location else {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
for filter in self.chatListDisplayNode.mainContainerNode.availableFilters {
|
for filter in self.chatListDisplayNode.mainContainerNode.availableFilters {
|
||||||
if case let .filter(filter) = filter, case let .filter(filterId, _, _, data) = filter, filterId == id {
|
if case let .filter(filter) = filter, case let .filter(filterId, _, _, data) = filter, filterId == id {
|
||||||
let filterPredicate = chatListFilterPredicate(filter: data)
|
let filterPredicate = chatListFilterPredicate(filter: data)
|
||||||
var markItems: [(groupId: EngineChatList.Group, filterPredicate: ChatListFilterPredicate?)] = []
|
var markItems: [(groupId: EngineChatList.Group, filterPredicate: ChatListFilterPredicate?)] = []
|
||||||
markItems.append((groupId, filterPredicate))
|
markItems.append((.root, filterPredicate))
|
||||||
for additionalGroupId in filterPredicate.includeAdditionalPeerGroupIds {
|
for additionalGroupId in filterPredicate.includeAdditionalPeerGroupIds {
|
||||||
markItems.append((EngineChatList.Group(additionalGroupId), filterPredicate))
|
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)
|
status = .custom(string: strings.GroupInfo_ParticipantCount(Int32(group.participantCount)), multiline: false, isActive: false, icon: nil)
|
||||||
} else if case let .channel(channel) = primaryPeer {
|
} else if case let .channel(channel) = primaryPeer {
|
||||||
if case .group = channel.info {
|
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)
|
status = .custom(string: strings.GroupInfo_ParticipantCount(Int32(count)), multiline: false, isActive: false, icon: nil)
|
||||||
} else {
|
} else {
|
||||||
status = .custom(string: strings.Group_Status, multiline: false, isActive: false, icon: nil)
|
status = .custom(string: strings.Group_Status, multiline: false, isActive: false, icon: nil)
|
||||||
}
|
}
|
||||||
} else {
|
} 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)
|
status = .custom(string: strings.Conversation_StatusSubscribers(Int32(count)), multiline: false, isActive: false, icon: nil)
|
||||||
} else {
|
} else {
|
||||||
status = .custom(string: strings.Channel_Status, multiline: false, isActive: false, icon: nil)
|
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
|
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 navigationBar = self.navigationBar {
|
||||||
if let contentNode = navigationBar.contentNode, case .expansion = contentNode.mode, !self.displayNavigationBar {
|
if let contentNode = navigationBar.contentNode, case .expansion = contentNode.mode, !self.displayNavigationBar {
|
||||||
navigationBarFrame.origin.y -= navigationLayout.defaultContentHeight
|
navigationBarFrame.origin.y -= navigationLayout.defaultContentHeight
|
||||||
@ -420,6 +422,7 @@ public protocol CustomViewControllerNavigationDataSummary: AnyObject {
|
|||||||
navigationBarFrame.size.height += NavigationBar.defaultSecondaryContentHeight
|
navigationBarFrame.size.height += NavigationBar.defaultSecondaryContentHeight
|
||||||
//navigationBarFrame.origin.y += 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)
|
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 {
|
if !transition.isAnimated {
|
||||||
navigationBar.layer.removeAnimation(forKey: "bounds")
|
navigationBar.layer.removeAnimation(forKey: "bounds")
|
||||||
|
@ -8,7 +8,7 @@ import GZip
|
|||||||
import AppBundle
|
import AppBundle
|
||||||
import LegacyComponents
|
import LegacyComponents
|
||||||
|
|
||||||
private let sceneVersion: Int = 3
|
private let sceneVersion: Int = 4
|
||||||
|
|
||||||
private func deg2rad(_ number: Float) -> Float {
|
private func deg2rad(_ number: Float) -> Float {
|
||||||
return number * .pi / 180
|
return number * .pi / 180
|
||||||
|
@ -103,7 +103,7 @@ final class TabBarControllerNode: ASDisplayNode {
|
|||||||
transition.updateFrame(node: toolbarNode, frame: tabBarFrame)
|
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)
|
toolbarNode.updateLayout(size: tabBarFrame.size, leftInset: layout.safeInsets.left, rightInset: layout.safeInsets.right, additionalSideInsets: layout.additionalInsets, bottomInset: bottomInset, toolbar: toolbar, transition: transition)
|
||||||
} else {
|
} 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)
|
self?.toolbarActionSelected(.left)
|
||||||
}, right: { [weak self] in
|
}, right: { [weak self] in
|
||||||
self?.toolbarActionSelected(.right)
|
self?.toolbarActionSelected(.right)
|
||||||
|
@ -527,7 +527,7 @@ public final class MediaNavigationAccessoryHeaderNode: ASDisplayNode, UIScrollVi
|
|||||||
return speedList
|
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] = []
|
var presetItems: [ContextMenuItem] = []
|
||||||
|
|
||||||
let previousValue = self.playbackBaseRate?.doubleValue ?? 1.0
|
let previousValue = self.playbackBaseRate?.doubleValue ?? 1.0
|
||||||
@ -548,6 +548,7 @@ public final class MediaNavigationAccessoryHeaderNode: ASDisplayNode, UIScrollVi
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}, action: { [weak self] _, f in
|
}, action: { [weak self] _, f in
|
||||||
|
scheduleTooltip(nil)
|
||||||
f(.default)
|
f(.default)
|
||||||
|
|
||||||
self?.setRate?(rate, .preset)
|
self?.setRate?(rate, .preset)
|
||||||
|
@ -1030,7 +1030,7 @@ final class OverlayPlayerControlsNode: ASDisplayNode {
|
|||||||
return speedList
|
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] = []
|
var presetItems: [ContextMenuItem] = []
|
||||||
|
|
||||||
let previousValue = self.currentRate?.doubleValue ?? 1.0
|
let previousValue = self.currentRate?.doubleValue ?? 1.0
|
||||||
@ -1051,6 +1051,7 @@ final class OverlayPlayerControlsNode: ASDisplayNode {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}, action: { [weak self] _, f in
|
}, action: { [weak self] _, f in
|
||||||
|
scheduleTooltip(nil)
|
||||||
f(.default)
|
f(.default)
|
||||||
|
|
||||||
self?.control?(.setBaseRate(rate))
|
self?.control?(.setBaseRate(rate))
|
||||||
|
@ -262,7 +262,7 @@ final class PeerSelectionControllerNode: ASDisplayNode {
|
|||||||
strongSelf.contentOffsetChanged?(offset)
|
strongSelf.contentOffsetChanged?(offset)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.mainContainerNode?.contentOffsetChanged = { [weak self] offset in
|
self.mainContainerNode?.contentOffsetChanged = { [weak self] offset in
|
||||||
guard let strongSelf = self else {
|
guard let strongSelf = self else {
|
||||||
return
|
return
|
||||||
@ -569,10 +569,19 @@ final class PeerSelectionControllerNode: ASDisplayNode {
|
|||||||
} else {
|
} else {
|
||||||
var selectedPeerIds: [PeerId] = []
|
var selectedPeerIds: [PeerId] = []
|
||||||
var selectedPeerMap: [PeerId: Peer] = [:]
|
var selectedPeerMap: [PeerId: Peer] = [:]
|
||||||
strongSelf.chatListNode?.updateState { state in
|
if let mainContainerNode = strongSelf.mainContainerNode {
|
||||||
selectedPeerIds = Array(state.selectedPeerIds)
|
mainContainerNode.currentItemNode.updateState { state in
|
||||||
selectedPeerMap = state.selectedPeerMap.mapValues({ $0._asPeer() })
|
selectedPeerIds = Array(state.selectedPeerIds)
|
||||||
return state
|
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 {
|
if !selectedPeerIds.isEmpty {
|
||||||
var selectedPeers: [Peer] = []
|
var selectedPeers: [Peer] = []
|
||||||
@ -598,10 +607,21 @@ final class PeerSelectionControllerNode: ASDisplayNode {
|
|||||||
return ContactListNodeGroupSelectionState()
|
return ContactListNodeGroupSelectionState()
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
self.chatListNode?.updateState { state in
|
if let mainContainerNode = self.mainContainerNode {
|
||||||
var state = state
|
mainContainerNode.currentItemNode.selectionCountChanged = { [weak self] count in
|
||||||
state.editing = true
|
self?.textInputPanelNode?.updateSendButtonEnabled(count > 0, animated: true)
|
||||||
return state
|
}
|
||||||
|
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.top += navigationBarHeight
|
||||||
insets.bottom = max(insets.bottom, cleanInsets.bottom + 44.0)
|
insets.bottom = max(insets.bottom, toolbarHeight)
|
||||||
insets.left += layout.safeInsets.left
|
insets.left += layout.safeInsets.left
|
||||||
insets.right += layout.safeInsets.right
|
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.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)
|
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: insets, 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: contactsInsets, 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 {
|
if let searchDisplayController = self.searchDisplayController {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user