mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-02 00:17:02 +00:00
Monoforums
This commit is contained in:
parent
3910ecdca2
commit
2a3e3ad4ba
@ -862,6 +862,10 @@ open class ListView: ASDisplayNode, ASScrollViewDelegate, ASGestureRecognizerDel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public func resetScrolledToItem() {
|
||||||
|
self.scrolledToItem = nil
|
||||||
|
}
|
||||||
|
|
||||||
public func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint>) {
|
public func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint>) {
|
||||||
if let shouldStopScrolling = self.shouldStopScrolling, shouldStopScrolling(velocity.y) {
|
if let shouldStopScrolling = self.shouldStopScrolling, shouldStopScrolling(velocity.y) {
|
||||||
targetContentOffset.pointee.y = scrollView.contentOffset.y
|
targetContentOffset.pointee.y = scrollView.contentOffset.y
|
||||||
|
@ -1423,7 +1423,7 @@ public class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
|||||||
strongSelf.contextSourceNode.contentNode.insertSubnode(strongSelf.textNode.textNode, aboveSubnode: strongSelf.imageNode)
|
strongSelf.contextSourceNode.contentNode.insertSubnode(strongSelf.textNode.textNode, aboveSubnode: strongSelf.imageNode)
|
||||||
}
|
}
|
||||||
|
|
||||||
strongSelf.textNode.textNode.frame = imageFrame
|
animation.animator.updateFrame(layer: strongSelf.textNode.textNode.layer, frame: imageFrame, completion: nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
animation.animator.updateFrame(layer: strongSelf.imageNode.layer, frame: updatedContentFrame, completion: nil)
|
animation.animator.updateFrame(layer: strongSelf.imageNode.layer, frame: updatedContentFrame, completion: nil)
|
||||||
|
@ -141,7 +141,14 @@ private func messagesShouldBeMerged(accountPeerId: PeerId, _ lhs: Message, _ rhs
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if abs(lhsEffectiveTimestamp - rhsEffectiveTimestamp) < Int32(10 * 60) && sameChat && sameAuthor && sameThread && !isPaid {
|
var isNonMergeablePaid = isPaid
|
||||||
|
if isNonMergeablePaid {
|
||||||
|
if let channel = lhs.peers[lhs.id.peerId] as? TelegramChannel, channel.flags.contains(.isMonoforum) {
|
||||||
|
isNonMergeablePaid = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if abs(lhsEffectiveTimestamp - rhsEffectiveTimestamp) < Int32(10 * 60) && sameChat && sameAuthor && sameThread && !isNonMergeablePaid {
|
||||||
if let channel = lhs.peers[lhs.id.peerId] as? TelegramChannel, case .group = channel.info, lhsEffectiveAuthor?.id == channel.id, !lhs.effectivelyIncoming(accountPeerId) {
|
if let channel = lhs.peers[lhs.id.peerId] as? TelegramChannel, case .group = channel.info, lhsEffectiveAuthor?.id == channel.id, !lhs.effectivelyIncoming(accountPeerId) {
|
||||||
return .none
|
return .none
|
||||||
}
|
}
|
||||||
|
@ -810,12 +810,19 @@ extension ChatControllerImpl {
|
|||||||
contactStatus = ChatContactStatus(canAddContact: false, peerStatusSettings: cachedData.peerStatusSettings, invitedBy: invitedBy, managingBot: managingBot)
|
contactStatus = ChatContactStatus(canAddContact: false, peerStatusSettings: cachedData.peerStatusSettings, invitedBy: invitedBy, managingBot: managingBot)
|
||||||
|
|
||||||
if let channel = peerView.peers[peerView.peerId] as? TelegramChannel {
|
if let channel = peerView.peers[peerView.peerId] as? TelegramChannel {
|
||||||
|
if channel.isMonoForum {
|
||||||
|
if let linkedMonoforumId = channel.linkedMonoforumId, let mainChannel = peerView.peers[linkedMonoforumId] as? TelegramChannel, mainChannel.hasPermission(.sendSomething) {
|
||||||
|
} else {
|
||||||
|
sendPaidMessageStars = channel.sendPaidMessageStars
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if channel.flags.contains(.isCreator) || channel.adminRights != nil {
|
if channel.flags.contains(.isCreator) || channel.adminRights != nil {
|
||||||
} else {
|
} else {
|
||||||
sendPaidMessageStars = channel.sendPaidMessageStars
|
sendPaidMessageStars = channel.sendPaidMessageStars
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var peers = SimpleDictionary<PeerId, Peer>()
|
var peers = SimpleDictionary<PeerId, Peer>()
|
||||||
peers[peer.id] = peer
|
peers[peer.id] = peer
|
||||||
|
@ -2046,6 +2046,10 @@ class ChatControllerNode: ASDisplayNode, ASScrollViewDelegate {
|
|||||||
transition.updatePosition(node: self.historyNode, position: CGPoint(x: contentBounds.size.width / 2.0, y: contentBounds.size.height / 2.0))
|
transition.updatePosition(node: self.historyNode, position: CGPoint(x: contentBounds.size.width / 2.0, y: contentBounds.size.height / 2.0))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if immediatelyLayoutLeftPanelNodeAndAnimateAppearance || dismissedLeftPanel != nil || immediatelyLayoutTitleTopicsAccessoryPanelNodeAndAnimateAppearance || dismissedTitleTopicsAccessoryPanelNode != nil {
|
||||||
|
self.historyNode.resetScrolledToItem()
|
||||||
|
}
|
||||||
|
|
||||||
if let blurredHistoryNode = self.blurredHistoryNode {
|
if let blurredHistoryNode = self.blurredHistoryNode {
|
||||||
transition.updateFrame(node: blurredHistoryNode, frame: contentBounds)
|
transition.updateFrame(node: blurredHistoryNode, frame: contentBounds)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user