mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Merge commit 'f8890b9734747aba09ab7a965857ff8f42b22dd0' into beta
This commit is contained in:
commit
98f0622c2a
@ -160,7 +160,7 @@ public func peerAvatarImage(account: Account, peerReference: PeerReference?, aut
|
||||
shouldBlur = true
|
||||
}
|
||||
if shouldBlur {
|
||||
let imageContextSize = CGSize(width: 64.0, height: 64.0)
|
||||
let imageContextSize = size.width > 200.0 ? CGSize(width: 192.0, height: 192.0) : CGSize(width: 64.0, height: 64.0)
|
||||
let imageContext = DrawingContext(size: imageContextSize, scale: 1.0, clear: true)
|
||||
imageContext.withFlippedContext { c in
|
||||
c.draw(dataImage, in: CGRect(origin: CGPoint(), size: imageContextSize))
|
||||
@ -172,6 +172,12 @@ public func peerAvatarImage(account: Account, peerReference: PeerReference?, aut
|
||||
}
|
||||
|
||||
telegramFastBlurMore(Int32(imageContext.size.width * imageContext.scale), Int32(imageContext.size.height * imageContext.scale), Int32(imageContext.bytesPerRow), imageContext.bytes)
|
||||
if size.width > 200.0 {
|
||||
telegramFastBlurMore(Int32(imageContext.size.width * imageContext.scale), Int32(imageContext.size.height * imageContext.scale), Int32(imageContext.bytesPerRow), imageContext.bytes)
|
||||
telegramFastBlurMore(Int32(imageContext.size.width * imageContext.scale), Int32(imageContext.size.height * imageContext.scale), Int32(imageContext.bytesPerRow), imageContext.bytes)
|
||||
telegramFastBlurMore(Int32(imageContext.size.width * imageContext.scale), Int32(imageContext.size.height * imageContext.scale), Int32(imageContext.bytesPerRow), imageContext.bytes)
|
||||
telegramFastBlurMore(Int32(imageContext.size.width * imageContext.scale), Int32(imageContext.size.height * imageContext.scale), Int32(imageContext.bytesPerRow), imageContext.bytes)
|
||||
}
|
||||
|
||||
dataImage = imageContext.generateImage()!.cgImage!
|
||||
}
|
||||
|
@ -92,14 +92,19 @@ public func imageRequiresInversion(_ cgImage: CGImage) -> Bool {
|
||||
}
|
||||
|
||||
if hasAlpha {
|
||||
let probingContext = DrawingContext(size: CGSize(width: cgImage.width, height: cgImage.height))
|
||||
probingContext.withContext { c in
|
||||
c.draw(cgImage, in: CGRect(origin: CGPoint(), size: probingContext.size))
|
||||
}
|
||||
|
||||
var matching: Int = 0
|
||||
var total: Int = 0
|
||||
for y in 0 ..< Int(context.size.height) {
|
||||
for x in 0 ..< Int(context.size.width) {
|
||||
for y in 0 ..< Int(probingContext.size.height) {
|
||||
for x in 0 ..< Int(probingContext.size.width) {
|
||||
var saturation: CGFloat = 0.0
|
||||
var brightness: CGFloat = 0.0
|
||||
var alpha: CGFloat = 0.0
|
||||
if context.colorAt(CGPoint(x: x, y: y)).getHue(nil, saturation: &saturation, brightness: &brightness, alpha: &alpha) {
|
||||
if probingContext.colorAt(CGPoint(x: x, y: y)).getHue(nil, saturation: &saturation, brightness: &brightness, alpha: &alpha) {
|
||||
if alpha < 1.0 {
|
||||
hasAlpha = true
|
||||
}
|
||||
|
@ -632,8 +632,8 @@ final class ImportStickerPackControllerNode: ViewControllerTracingNode, UIScroll
|
||||
firstItem = StickerPackItem(index: ItemCollectionItemIndex(index: 0, id: 0), file: TelegramMediaFile(fileId: MediaId(namespace: 0, id: 0), partialReference: nil, resource: resource, previewRepresentations: [], videoThumbnails: [], immediateThumbnailData: nil, mimeType: stickerPack.isAnimated ? "application/x-tgsticker": "image/png", size: nil, attributes: [.FileName(fileName: stickerPack.isAnimated ? "sticker.tgs" : "sticker.png"), .ImageSize(size: firstStickerItem.dimensions)]), indexKeys: [])
|
||||
}
|
||||
strongSelf.presentInGlobalOverlay?(UndoOverlayController(presentationData: strongSelf.presentationData, content: .stickersModified(title: strongSelf.presentationData.strings.StickerPackActionInfo_AddedTitle, text: strongSelf.presentationData.strings.StickerPackActionInfo_AddedText(info.title).0, undo: false, info: info, topItem: firstItem ?? items.first, context: strongSelf.context), elevatedLayout: false, action: { _ in
|
||||
(navigationController?.viewControllers.last as? ViewController)?.present(StickerPackScreen(context: context, mode: .settings, mainStickerPack: .id(id: info.id.id, accessHash: info.accessHash), stickerPacks: [], parentNavigationController: navigationController, actionPerformed: { _, _, _ in
|
||||
}), in: .window(.root))
|
||||
// (navigationController?.viewControllers.last as? ViewController)?.present(StickerPackScreen(context: context, mode: .settings, mainStickerPack: .id(id: info.id.id, accessHash: info.accessHash), stickerPacks: [], parentNavigationController: navigationController, actionPerformed: { _, _, _ in
|
||||
// }), in: .window(.root))
|
||||
return true
|
||||
}), nil)
|
||||
strongSelf.cancel?()
|
||||
|
@ -195,12 +195,12 @@ private class TextField: UITextField, UIScrollViewDelegate {
|
||||
let textRect = self.textRect(forBounds: bounds)
|
||||
|
||||
let labelSize = self.placeholderLabel.updateLayout(textRect.size)
|
||||
self.placeholderLabel.frame = CGRect(origin: CGPoint(x: textRect.minX, y: floorToScreenPixels((bounds.height - labelSize.height) / 2.0)), size: labelSize)
|
||||
self.placeholderLabel.frame = CGRect(origin: CGPoint(x: textRect.minX + 3.0, y: floorToScreenPixels((bounds.height - labelSize.height) / 2.0)), size: labelSize)
|
||||
|
||||
let prefixSize = self.prefixLabel.updateLayout(CGSize(width: floor(bounds.size.width * 0.7), height: bounds.size.height))
|
||||
let prefixBounds = bounds.insetBy(dx: 4.0, dy: 4.0)
|
||||
self.prefixLabel.frame = CGRect(origin: CGPoint(x: prefixBounds.minX, y: floorToScreenPixels((bounds.height - prefixSize.height) / 2.0)), size: prefixSize)
|
||||
self.updatePrefixWidth(prefixSize.width)
|
||||
self.updatePrefixWidth(prefixSize.width + 3.0)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -298,7 +298,7 @@ public class ItemListVenueItemNode: ListViewItemNode, ItemListItemNode {
|
||||
strongSelf.topStripeNode.removeFromSupernode()
|
||||
}
|
||||
if strongSelf.bottomStripeNode.supernode == nil {
|
||||
strongSelf.addSubnode(strongSelf.bottomStripeNode)
|
||||
strongSelf.insertSubnode(strongSelf.bottomStripeNode, at: 0)
|
||||
}
|
||||
if strongSelf.maskNode.supernode != nil {
|
||||
strongSelf.maskNode.removeFromSupernode()
|
||||
|
@ -19,6 +19,7 @@ final class GroupVideoNode: ASDisplayNode {
|
||||
case fillOrFitToSquare
|
||||
case fillHorizontal
|
||||
case fillVertical
|
||||
case fit
|
||||
}
|
||||
|
||||
let sourceContainerNode: PinchSourceContainerNode
|
||||
@ -252,6 +253,8 @@ final class GroupVideoNode: ASDisplayNode {
|
||||
let filledToSquareSize = rotatedVideoSize.aspectFilled(CGSize(width: squareSide, height: squareSide))
|
||||
|
||||
switch layoutMode {
|
||||
case .fit:
|
||||
rotatedVideoSize = fittedSize
|
||||
case .fillOrFitToSquare:
|
||||
rotatedVideoSize = filledToSquareSize
|
||||
case .fillHorizontal:
|
||||
|
@ -1179,7 +1179,7 @@ public final class VoiceChatController: ViewController {
|
||||
self.itemInteraction = Interaction(updateIsMuted: { [weak self] peerId, isMuted in
|
||||
let _ = self?.call.updateMuteState(peerId: peerId, isMuted: isMuted)
|
||||
}, switchToPeer: { [weak self] peerId, videoEndpointId, expand in
|
||||
if let strongSelf = self {
|
||||
if let strongSelf = self, strongSelf.connectedOnce {
|
||||
if expand, let videoEndpointId = videoEndpointId {
|
||||
strongSelf.currentDominantSpeaker = (peerId, videoEndpointId, CACurrentMediaTime() + 3.0)
|
||||
strongSelf.updateDisplayMode(.fullscreen(controlsHidden: false))
|
||||
@ -3711,7 +3711,7 @@ public final class VoiceChatController: ViewController {
|
||||
forceUpdate = true
|
||||
}
|
||||
leftBorderFrame = CGRect(origin: CGPoint(x: -additionalInset - additionalLeftInset, y: topPanelFrame.maxY - additionalInset * (isFullscreen ? 0.95 : 0.8)), size: CGSize(width: sideInset + additionalInset + additionalLeftInset + (contentLeftInset.isZero ? additionalSideInset : contentLeftInset), height: layout.size.height))
|
||||
rightBorderFrame = CGRect(origin: CGPoint(x: size.width - sideInset - (contentLeftInset.isZero ? additionalSideInset : 0.0), y: topPanelFrame.maxY - additionalInset * (isFullscreen ? 0.95 : 0.8)), size: CGSize(width: sideInset + additionalInset + additionalSideInset, height: layout.size.height))
|
||||
rightBorderFrame = CGRect(origin: CGPoint(x: size.width - sideInset - (contentLeftInset.isZero ? additionalSideInset : 0.0), y: topPanelFrame.maxY - additionalInset * (isFullscreen ? 0.95 : 0.8)), size: CGSize(width: sideInset + additionalInset + additionalLeftInset + additionalSideInset, height: layout.size.height))
|
||||
}
|
||||
|
||||
let topCornersFrame = CGRect(x: sideInset + (contentLeftInset.isZero ? floorToScreenPixels((size.width - contentWidth) / 2.0) : contentLeftInset), y: topPanelFrame.maxY - 60.0, width: contentWidth - sideInset * 2.0, height: 50.0 + 60.0)
|
||||
@ -3722,6 +3722,13 @@ public final class VoiceChatController: ViewController {
|
||||
let previousRightBorderFrame = self.rightBorderNode.frame
|
||||
|
||||
if !topPanelFrame.equalTo(previousTopPanelFrame) || forceUpdate {
|
||||
if topPanelFrame.width != previousTopPanelFrame.width {
|
||||
transition.updateFrame(node: self.topPanelNode, frame: topPanelFrame)
|
||||
transition.updateFrame(node: self.topCornersNode, frame: topCornersFrame)
|
||||
transition.updateFrame(node: self.backgroundNode, frame: backgroundFrame)
|
||||
transition.updateFrame(node: self.leftBorderNode, frame: leftBorderFrame)
|
||||
transition.updateFrame(node: self.rightBorderNode, frame: rightBorderFrame)
|
||||
} else {
|
||||
self.topPanelNode.frame = topPanelFrame
|
||||
let positionDelta = CGPoint(x: 0.0, y: topPanelFrame.minY - previousTopPanelFrame.minY)
|
||||
transition.animateOffsetAdditive(layer: self.topPanelNode.layer, offset: positionDelta.y, completion: completion)
|
||||
@ -3739,6 +3746,7 @@ public final class VoiceChatController: ViewController {
|
||||
self.rightBorderNode.frame = rightBorderFrame
|
||||
let rightBorderPositionDelta = CGPoint(x: previousRightBorderFrame.minX - rightBorderFrame.minX, y: previousRightBorderFrame.minY - rightBorderFrame.minY)
|
||||
transition.animatePositionAdditive(node: self.rightBorderNode, offset: rightBorderPositionDelta)
|
||||
}
|
||||
} else {
|
||||
completion?()
|
||||
}
|
||||
@ -3749,16 +3757,22 @@ public final class VoiceChatController: ViewController {
|
||||
let bottomOffset = min(0.0, bottomEdge - listMaxY) + layout.size.height - bottomPanelHeight
|
||||
|
||||
let bottomCornersFrame = CGRect(origin: CGPoint(x: sideInset + floorToScreenPixels((size.width - contentWidth) / 2.0), y: -50.0 + bottomOffset + bottomGradientHeight), size: CGSize(width: contentWidth - sideInset * 2.0, height: 50.0 + 60.0))
|
||||
let bottomPanelBackgroundFrame = CGRect(x: 0.0, y: bottomOffset + bottomGradientHeight, width: size.width, height: 2000.0)
|
||||
let previousBottomCornersFrame = self.bottomCornersNode.frame
|
||||
if !bottomCornersFrame.equalTo(previousBottomCornersFrame) {
|
||||
if bottomCornersFrame.width != previousBottomCornersFrame.width {
|
||||
transition.updateFrame(node: self.bottomCornersNode, frame: bottomCornersFrame)
|
||||
transition.updateFrame(node: self.bottomPanelBackgroundNode, frame: bottomPanelBackgroundFrame)
|
||||
} else {
|
||||
self.bottomCornersNode.frame = bottomCornersFrame
|
||||
self.bottomPanelBackgroundNode.frame = CGRect(x: 0.0, y: bottomOffset + bottomGradientHeight, width: size.width, height: 2000.0)
|
||||
self.bottomPanelBackgroundNode.frame = bottomPanelBackgroundFrame
|
||||
|
||||
let positionDelta = CGPoint(x: 0.0, y: previousBottomCornersFrame.minY - bottomCornersFrame.minY)
|
||||
transition.animatePositionAdditive(node: self.bottomCornersNode, offset: positionDelta)
|
||||
transition.animatePositionAdditive(node: self.bottomPanelBackgroundNode, offset: positionDelta)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var decorationsAreDark: Bool?
|
||||
private var ignoreLayout = false
|
||||
@ -4975,7 +4989,7 @@ public final class VoiceChatController: ViewController {
|
||||
|
||||
self.joinedVideo = joinedVideo
|
||||
|
||||
if !joinedVideo && !tileItems.isEmpty || !gridTileItems.isEmpty, let peer = self.peer {
|
||||
if !joinedVideo && (!tileItems.isEmpty || !gridTileItems.isEmpty), let peer = self.peer {
|
||||
tileItems.removeAll()
|
||||
gridTileItems.removeAll()
|
||||
|
||||
|
@ -724,7 +724,7 @@ final class VoiceChatMainStageNode: ASDisplayNode {
|
||||
let peer = peerEntry.peer
|
||||
let presentationData = self.context.sharedContext.currentPresentationData.with { $0 }
|
||||
if !arePeersEqual(previousPeerEntry?.peer, peerEntry.peer) {
|
||||
self.backdropAvatarNode.setSignal(peerAvatarCompleteImage(account: self.context.account, peer: peer, size: CGSize(width: 180.0, height: 180.0), round: false, font: avatarPlaceholderFont(size: 78.0), drawLetters: false, blurred: true))
|
||||
self.backdropAvatarNode.setSignal(peerAvatarCompleteImage(account: self.context.account, peer: peer, size: CGSize(width: 240.0, height: 240.0), round: false, font: avatarPlaceholderFont(size: 78.0), drawLetters: false, blurred: true))
|
||||
self.avatarNode.setSignal(peerAvatarCompleteImage(account: self.context.account, peer: peer, size: CGSize(width: 180.0, height: 180.0), font: avatarPlaceholderFont(size: 78.0), fullSize: true))
|
||||
}
|
||||
|
||||
@ -1097,9 +1097,13 @@ final class VoiceChatMainStageNode: ASDisplayNode {
|
||||
} else if self.animatingOut {
|
||||
layoutMode = .fillOrFitToSquare
|
||||
bottomInset = 0.0
|
||||
} else {
|
||||
if let (_, _, _, isPresentation, _) = self.currentPeer, isPresentation {
|
||||
layoutMode = .fit
|
||||
} else {
|
||||
layoutMode = isLandscape ? .fillHorizontal : .fillVertical
|
||||
}
|
||||
}
|
||||
|
||||
if let currentVideoNode = self.currentVideoNode {
|
||||
transition.updateFrame(node: currentVideoNode, frame: CGRect(origin: CGPoint(), size: size))
|
||||
|
@ -133,15 +133,12 @@ final class VoiceChatTileGridNode: ASDisplayNode {
|
||||
}
|
||||
if let itemNode = itemNode {
|
||||
itemNode.visibility = self.visibility
|
||||
if wasAdded {
|
||||
itemNode.frame = itemFrame
|
||||
if !isFirstTime {
|
||||
let itemTransition: ContainedViewLayoutTransition = wasAdded ? .immediate : transition
|
||||
itemTransition.updateFrameAsPositionAndBounds(node: itemNode, frame: itemFrame)
|
||||
if wasAdded && !isFirstTime {
|
||||
itemNode.layer.animateScale(from: 0.0, to: 1.0, duration: wasEmpty ? 0.4 : 0.3)
|
||||
itemNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
|
||||
}
|
||||
} else {
|
||||
transition.updateFrame(node: itemNode, frame: itemFrame)
|
||||
}
|
||||
|
||||
if let (rect, containerSize) = self.absoluteLocation {
|
||||
var localRect = rect
|
||||
@ -160,7 +157,7 @@ final class VoiceChatTileGridNode: ASDisplayNode {
|
||||
}
|
||||
for id in removeIds {
|
||||
if let itemNode = self.itemNodes.removeValue(forKey: id) {
|
||||
itemNode.layer.animateScale(from: 1.0, to: 0.0, duration: 0.3, removeOnCompletion: false)
|
||||
itemNode.layer.animateScale(from: 1.0, to: 0.0, duration: 0.3, removeOnCompletion: false, additive: true)
|
||||
itemNode.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.2, removeOnCompletion: false, completion: { [weak itemNode] _ in
|
||||
itemNode?.removeFromSupernode()
|
||||
})
|
||||
|
@ -30,11 +30,9 @@ private func managedRecentMedia(postbox: Postbox, network: Network, collectionId
|
||||
|> mapToSignal { sourceItems in
|
||||
var items: [OrderedItemListEntry] = []
|
||||
if let sourceItems = sourceItems {
|
||||
var existingIds = Set<MediaId>()
|
||||
var existingIds = Set<Data>()
|
||||
for item in sourceItems {
|
||||
guard let id = (item.contents as? RecentMediaItem)?.media.id else {
|
||||
continue
|
||||
}
|
||||
let id = item.id.makeData()
|
||||
if !existingIds.contains(id) {
|
||||
existingIds.insert(id)
|
||||
items.append(item)
|
||||
|
@ -1009,12 +1009,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
strongSelf.updateChatPresentationInterfaceState(animated: true, interactive: true, { $0.updatedInterfaceState { $0.withToggledSelectedMessages(ids, value: value) } })
|
||||
if let selectionState = strongSelf.presentationInterfaceState.interfaceState.selectionState {
|
||||
let count = selectionState.selectedIds.count
|
||||
let text: String
|
||||
if count == 1 {
|
||||
text = "1 message selected"
|
||||
} else {
|
||||
text = "\(count) messages selected"
|
||||
}
|
||||
let text = strongSelf.presentationData.strings.VoiceOver_Chat_MessagesSelected(Int32(count))
|
||||
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.1, execute: {
|
||||
UIAccessibility.post(notification: UIAccessibility.Notification.announcement, argument: text as NSString)
|
||||
})
|
||||
|
@ -453,10 +453,12 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate {
|
||||
self.menuButton = HighlightTrackingButtonNode()
|
||||
self.menuButton.clipsToBounds = true
|
||||
self.menuButton.cornerRadius = 16.0
|
||||
self.menuButton.accessibilityLabel = presentationInterfaceState.strings.Conversation_InputMenu
|
||||
self.menuButtonBackgroundNode = ASDisplayNode()
|
||||
self.menuButtonClippingNode = ASDisplayNode()
|
||||
self.menuButtonClippingNode.clipsToBounds = true
|
||||
self.menuButtonIconNode = AnimationNode(animation: "anim_menuclose", colors: [:])
|
||||
|
||||
self.menuButtonIconNode = AnimationNode(animation: "anim_menuclose", colors: ["1.1.Обводка 1": presentationInterfaceState.theme.chat.inputPanel.actionControlForegroundColor, "2.2.Обводка 1": presentationInterfaceState.theme.chat.inputPanel.actionControlForegroundColor, "3.1.Обводка 1": presentationInterfaceState.theme.chat.inputPanel.actionControlForegroundColor])
|
||||
self.menuButtonTextNode = ImmediateTextNode()
|
||||
|
||||
self.attachmentButton = HighlightableButtonNode(pointerStyle: .circle)
|
||||
@ -477,7 +479,6 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate {
|
||||
|
||||
self.menuButton.addTarget(self, action: #selector(self.menuButtonPressed), forControlEvents: .touchUpInside)
|
||||
self.menuButton.highligthedChanged = { [weak self] highlighted in
|
||||
if let strongSelf = self {
|
||||
if let strongSelf = self {
|
||||
if highlighted {
|
||||
let transition: ContainedViewLayoutTransition = .animated(duration: 0.3, curve: .spring)
|
||||
@ -488,7 +489,6 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.attachmentButton.addTarget(self, action: #selector(self.attachmentButtonPressed), forControlEvents: .touchUpInside)
|
||||
self.attachmentButtonDisabledNode.addTarget(self, action: #selector(self.attachmentButtonPressed), forControlEvents: .touchUpInside)
|
||||
@ -810,9 +810,9 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate {
|
||||
|
||||
if let previousShowCommands = previousState?.showCommands, previousShowCommands != interfaceState.showCommands {
|
||||
if interfaceState.showCommands {
|
||||
self.menuButtonIconNode.setAnimation(name: "anim_menuclose", colors: [:])
|
||||
self.menuButtonIconNode.setAnimation(name: "anim_menuclose", colors: ["1.1.Обводка 1": interfaceState.theme.chat.inputPanel.actionControlForegroundColor, "2.2.Обводка 1": interfaceState.theme.chat.inputPanel.actionControlForegroundColor, "3.1.Обводка 1": interfaceState.theme.chat.inputPanel.actionControlForegroundColor])
|
||||
} else {
|
||||
self.menuButtonIconNode.setAnimation(name: "anim_closemenu", colors: [:])
|
||||
self.menuButtonIconNode.setAnimation(name: "anim_closemenu", colors: ["1.1.Обводка 1": interfaceState.theme.chat.inputPanel.actionControlForegroundColor, "2.2.Обводка 1": interfaceState.theme.chat.inputPanel.actionControlForegroundColor, "3.1.Обводка 1": interfaceState.theme.chat.inputPanel.actionControlForegroundColor])
|
||||
}
|
||||
self.menuButtonIconNode.playOnce()
|
||||
}
|
||||
@ -851,6 +851,7 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate {
|
||||
|
||||
self.menuButtonBackgroundNode.backgroundColor = interfaceState.theme.chat.inputPanel.actionControlFillColor
|
||||
self.menuButtonTextNode.attributedText = NSAttributedString(string: interfaceState.strings.Conversation_InputMenu, font: Font.with(size: 16.0, design: .round, weight: .medium, traits: []), textColor: interfaceState.theme.chat.inputPanel.actionControlForegroundColor)
|
||||
self.menuButton.accessibilityLabel = interfaceState.strings.Conversation_InputMenu
|
||||
menuTextSize = self.menuButtonTextNode.updateLayout(CGSize(width: width, height: 44.0))
|
||||
|
||||
if isEditingMedia {
|
||||
|
@ -1050,7 +1050,7 @@ func peerInfoHeaderButtons(peer: Peer?, cachedData: CachedPeerData?, isOpenedFro
|
||||
result.append(.discussion)
|
||||
}
|
||||
result.append(.search)
|
||||
if displayLeave {
|
||||
if displayLeave && result.count < 4 {
|
||||
result.append(.leave)
|
||||
}
|
||||
var canReport = true
|
||||
|
@ -3689,8 +3689,7 @@ private final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewD
|
||||
self?.openDeletePeer()
|
||||
})))
|
||||
} else {
|
||||
if filteredButtons.contains(.leave) {
|
||||
if case .member = channel.participationStatus {
|
||||
if case .member = channel.participationStatus, !headerButtons.contains(.leave) {
|
||||
if !items.isEmpty {
|
||||
items.append(.separator)
|
||||
}
|
||||
@ -3703,7 +3702,6 @@ private final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewD
|
||||
})))
|
||||
}
|
||||
}
|
||||
}
|
||||
case .group:
|
||||
if channel.flags.contains(.isCreator) {
|
||||
if !items.isEmpty {
|
||||
@ -3717,7 +3715,7 @@ private final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewD
|
||||
self?.openDeletePeer()
|
||||
})))
|
||||
} else {
|
||||
if case .member = channel.participationStatus {
|
||||
if case .member = channel.participationStatus, !headerButtons.contains(.leave) {
|
||||
if !items.isEmpty {
|
||||
items.append(.separator)
|
||||
}
|
||||
@ -3732,7 +3730,7 @@ private final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewD
|
||||
}
|
||||
}
|
||||
} else if let group = peer as? TelegramGroup {
|
||||
if case .Member = group.membership {
|
||||
if case .Member = group.membership, !headerButtons.contains(.leave) {
|
||||
if !items.isEmpty {
|
||||
items.append(.separator)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user