Cherry-pick more fixes

This commit is contained in:
Ilya Laktyushin 2021-12-09 18:58:28 +04:00
parent 50848269a9
commit 4f325b354f
41 changed files with 984 additions and 1322 deletions

View File

@ -1236,6 +1236,7 @@ open class NavigationBar: ASDisplayNode {
public func makeTransitionBackButtonNode(accentColor: UIColor) -> NavigationButtonNode? {
if self.backButtonNode.supernode != nil {
let node = NavigationButtonNode()
node.manualAlpha = self.backButtonNode.manualAlpha
node.updateManualText(self.backButtonNode.manualText)
node.color = accentColor
if let validLayout = self.validLayout {

View File

@ -35,6 +35,8 @@ open class GalleryControllerNode: ASDisplayNode, UIScrollViewDelegate, UIGesture
public var areControlsHidden = false
public var controlsVisibilityChanged: ((Bool) -> Void)?
public var animateAlpha = true
public var updateOrientation: ((UIInterfaceOrientation) -> Void)?
public var isBackgroundExtendedOverNavigationBar = true {
@ -397,7 +399,7 @@ open class GalleryControllerNode: ASDisplayNode, UIScrollViewDelegate, UIGesture
contentAnimationCompleted = true
intermediateCompletion()
})
} else {
} else if self.animateAlpha {
self.scrollView.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.25, removeOnCompletion: false, completion: { _ in
contentAnimationCompleted = true
intermediateCompletion()

View File

@ -332,7 +332,7 @@ public func fetchedAvatarGalleryEntries(engine: TelegramEngine, account: Account
public class AvatarGalleryController: ViewController, StandalonePresentableController {
public enum SourceCorners {
case none
case round(Bool)
case round
case roundRect(CGFloat)
}
@ -382,7 +382,7 @@ public class AvatarGalleryController: ViewController, StandalonePresentableContr
private let editDisposable = MetaDisposable ()
public init(context: AccountContext, peer: Peer, sourceCorners: SourceCorners = .round(true), remoteEntries: Promise<[AvatarGalleryEntry]>? = nil, skipInitial: Bool = false, centralEntryIndex: Int? = nil, replaceRootController: @escaping (ViewController, Promise<Bool>?) -> Void, synchronousLoad: Bool = false) {
public init(context: AccountContext, peer: Peer, sourceCorners: SourceCorners = .round, remoteEntries: Promise<[AvatarGalleryEntry]>? = nil, skipInitial: Bool = false, centralEntryIndex: Int? = nil, replaceRootController: @escaping (ViewController, Promise<Bool>?) -> Void, synchronousLoad: Bool = false) {
self.context = context
self.peer = peer
self.sourceCorners = sourceCorners
@ -579,6 +579,7 @@ public class AvatarGalleryController: ViewController, StandalonePresentableContr
self.galleryNode.pager.updateOnReplacement = true
self.galleryNode.statusBar = self.statusBar
self.galleryNode.navigationBar = self.navigationBar
self.galleryNode.animateAlpha = false
self.galleryNode.transitionDataForCentralItem = { [weak self] in
if let strongSelf = self {

View File

@ -439,7 +439,7 @@ final class PeerAvatarImageGalleryItemNode: ZoomableContentGalleryItemNode {
self.contentNode.layer.animate(from: NSValue(caTransform3D: transform), to: NSValue(caTransform3D: self.contentNode.layer.transform), keyPath: "transform", timingFunction: kCAMediaTimingFunctionSpring, duration: 0.25)
self.contentNode.clipsToBounds = true
if case .round(true) = self.sourceCorners {
if case .round = self.sourceCorners {
self.contentNode.layer.animate(from: (self.contentNode.frame.width / 2.0) as NSNumber, to: 0.0 as NSNumber, keyPath: "cornerRadius", timingFunction: CAMediaTimingFunctionName.default.rawValue, duration: 0.18, removeOnCompletion: false, completion: { [weak self] value in
if value {
self?.contentNode.clipsToBounds = false

File diff suppressed because it is too large Load Diff

View File

@ -94,7 +94,6 @@ private enum ChannelVisibilityEntry: ItemListNodeEntry {
case existingLinkPeerItem(Int32, PresentationTheme, PresentationStrings, PresentationDateTimeFormat, PresentationPersonNameOrder, Peer, ItemListPeerItemEditing, Bool)
case forwardingHeader(PresentationTheme, String)
case forwardingEnabled(PresentationTheme, String, Bool)
case forwardingDisabled(PresentationTheme, String, Bool)
case forwardingInfo(PresentationTheme, String)
@ -108,7 +107,7 @@ private enum ChannelVisibilityEntry: ItemListNodeEntry {
return ChannelVisibilitySection.linkActions.rawValue
case .existingLinksInfo, .existingLinkPeerItem:
return ChannelVisibilitySection.link.rawValue
case .forwardingHeader, .forwardingEnabled, .forwardingDisabled, .forwardingInfo:
case .forwardingHeader, .forwardingDisabled, .forwardingInfo:
return ChannelVisibilitySection.forwarding.rawValue
}
}
@ -149,12 +148,10 @@ private enum ChannelVisibilityEntry: ItemListNodeEntry {
return 1001
case .forwardingHeader:
return 1002
case .forwardingEnabled:
return 1003
case .forwardingDisabled:
return 1004
return 1003
case .forwardingInfo:
return 1005
return 1004
}
}
@ -286,12 +283,6 @@ private enum ChannelVisibilityEntry: ItemListNodeEntry {
} else {
return false
}
case let .forwardingEnabled(lhsTheme, lhsText, lhsValue):
if case let .forwardingEnabled(rhsTheme, rhsText, rhsValue) = rhs, lhsTheme === rhsTheme, lhsText == rhsText, lhsValue == rhsValue {
return true
} else {
return false
}
case let .forwardingDisabled(lhsTheme, lhsText, lhsValue):
if case let .forwardingDisabled(rhsTheme, rhsText, rhsValue) = rhs, lhsTheme === rhsTheme, lhsText == rhsText, lhsValue == rhsValue {
return true
@ -403,13 +394,9 @@ private enum ChannelVisibilityEntry: ItemListNodeEntry {
})
case let .forwardingHeader(_, title):
return ItemListSectionHeaderItem(presentationData: presentationData, text: title, sectionId: self.section)
case let .forwardingEnabled(_, text, selected):
return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: selected, zeroSeparatorInsets: false, sectionId: self.section, action: {
arguments.toggleForwarding(true)
})
case let .forwardingDisabled(_, text, selected):
return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: selected, zeroSeparatorInsets: false, sectionId: self.section, action: {
arguments.toggleForwarding(false)
return ItemListSwitchItem(presentationData: presentationData, title: text, value: selected, sectionId: self.section, style: .blocks, updated: { value in
arguments.toggleForwarding(!value)
})
case let .forwardingInfo(_, text):
return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section)
@ -710,7 +697,6 @@ private func channelVisibilityControllerEntries(presentationData: PresentationDa
}
entries.append(.forwardingHeader(presentationData.theme, isGroup ? presentationData.strings.Group_Setup_ForwardingGroupTitle.uppercased() : presentationData.strings.Group_Setup_ForwardingChannelTitle.uppercased()))
entries.append(.forwardingEnabled(presentationData.theme, presentationData.strings.Group_Setup_ForwardingEnabled, forwardingEnabled))
entries.append(.forwardingDisabled(presentationData.theme, presentationData.strings.Group_Setup_ForwardingDisabled, !forwardingEnabled))
entries.append(.forwardingInfo(presentationData.theme, forwardingEnabled ? (isGroup ? presentationData.strings.Group_Setup_ForwardingGroupInfo : presentationData.strings.Group_Setup_ForwardingChannelInfo) : (isGroup ? presentationData.strings.Group_Setup_ForwardingGroupInfoDisabled : presentationData.strings.Group_Setup_ForwardingChannelInfoDisabled)))
@ -842,7 +828,6 @@ private func channelVisibilityControllerEntries(presentationData: PresentationDa
}
entries.append(.forwardingHeader(presentationData.theme, presentationData.strings.Group_Setup_ForwardingGroupTitle.uppercased()))
entries.append(.forwardingEnabled(presentationData.theme, presentationData.strings.Group_Setup_ForwardingEnabled, forwardingEnabled))
entries.append(.forwardingDisabled(presentationData.theme, presentationData.strings.Group_Setup_ForwardingDisabled, !forwardingEnabled))
entries.append(.forwardingInfo(presentationData.theme, forwardingEnabled ? presentationData.strings.Group_Setup_ForwardingGroupInfo : presentationData.strings.Group_Setup_ForwardingGroupInfoDisabled))
}

View File

@ -15,6 +15,9 @@ private let nullAction = NullActionClass()
public protocol SparseItemGridLayer: CALayer {
func update(size: CGSize)
func needsShimmer() -> Bool
func getContents() -> Any?
func setContents(_ contents: Any?)
}
public protocol SparseItemGridView: UIView {

View File

@ -613,7 +613,7 @@ public final class PresentationCallImpl: PresentationCall {
self.callKitIntegration?.reportIncomingCall(
uuid: self.internalId,
stableId: stableId,
handle: "\(self.peerId.id)",
handle: "\(self.peerId.id._internalGetInt64Value())",
isVideo: sessionState.type == .video,
displayTitle: self.peer?.debugDisplayTitle ?? "Unknown",
completion: { [weak self] error in

View File

@ -2576,35 +2576,39 @@ func replayFinalState(
}
if !message.flags.contains(.Incoming), message.forwardInfo == nil {
inner: for media in message.media {
if let file = media as? TelegramMediaFile {
for attribute in file.attributes {
switch attribute {
case let .Sticker(_, packReference, _):
if let index = message.index, packReference != nil {
if let (currentIndex, _) = recentlyUsedStickers[file.fileId] {
if currentIndex < index {
if [Namespaces.Peer.CloudGroup, Namespaces.Peer.CloudChannel].contains(message.id.peerId.namespace), let peer = transaction.getPeer(message.id.peerId), peer.isCopyProtectionEnabled {
} else {
inner: for media in message.media {
if let file = media as? TelegramMediaFile {
for attribute in file.attributes {
switch attribute {
case let .Sticker(_, packReference, _):
if let index = message.index, packReference != nil {
if let (currentIndex, _) = recentlyUsedStickers[file.fileId] {
if currentIndex < index {
recentlyUsedStickers[file.fileId] = (index, file)
}
} else {
recentlyUsedStickers[file.fileId] = (index, file)
}
} else {
recentlyUsedStickers[file.fileId] = (index, file)
}
}
case .Animated:
if let index = message.index {
if let (currentIndex, _) = recentlyUsedGifs[file.fileId] {
if currentIndex < index {
case .Animated:
if let index = message.index {
if let (currentIndex, _) = recentlyUsedGifs[file.fileId] {
if currentIndex < index {
recentlyUsedGifs[file.fileId] = (index, file)
}
} else {
recentlyUsedGifs[file.fileId] = (index, file)
}
} else {
recentlyUsedGifs[file.fileId] = (index, file)
}
}
default:
break
default:
break
}
}
break inner
}
break inner
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 322 B

View File

@ -1,22 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "BotLink@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "BotLink@3x.png",
"scale" : "3x"
"filename" : "botlink.pdf",
"idiom" : "universal"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}

View File

@ -0,0 +1,82 @@
%PDF-1.7
1 0 obj
<< >>
endobj
2 0 obj
<< /Length 3 0 R >>
stream
/DeviceRGB CS
/DeviceRGB cs
q
1.000000 0.000000 -0.000000 1.000000 1.000000 1.258984 cm
0.000000 0.000000 0.000000 scn
7.000000 7.571017 m
1.000000 7.571017 l
0.541604 7.571017 0.170000 7.199414 0.170000 6.741017 c
0.170000 6.282621 0.541604 5.911017 1.000000 5.911017 c
4.996202 5.911017 l
0.413101 1.327916 l
0.088966 1.003781 0.088966 0.478254 0.413101 0.154119 c
0.737236 -0.170016 1.262764 -0.170016 1.586899 0.154119 c
6.170000 4.737220 l
6.170000 0.741017 l
6.170000 0.282621 6.541604 -0.088983 7.000000 -0.088983 c
7.458396 -0.088983 7.830000 0.282621 7.830000 0.741017 c
7.830000 6.741017 l
7.830000 6.953433 7.748966 7.165848 7.586899 7.327916 c
7.507321 7.407494 7.415605 7.467534 7.317710 7.508038 c
7.219848 7.548619 7.112540 7.571017 7.000000 7.571017 c
h
f*
n
Q
endstream
endobj
3 0 obj
777
endobj
4 0 obj
<< /Annots []
/Type /Page
/MediaBox [ 0.000000 0.000000 10.000000 10.000000 ]
/Resources 1 0 R
/Contents 2 0 R
/Parent 5 0 R
>>
endobj
5 0 obj
<< /Kids [ 4 0 R ]
/Count 1
/Type /Pages
>>
endobj
6 0 obj
<< /Pages 5 0 R
/Type /Catalog
>>
endobj
xref
0 7
0000000000 65535 f
0000000010 00000 n
0000000034 00000 n
0000000867 00000 n
0000000889 00000 n
0000001062 00000 n
0000001136 00000 n
trailer
<< /ID [ (some) (id) ]
/Root 6 0 R
/Size 7
>>
startxref
1195
%%EOF

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 555 B

View File

@ -1,22 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "BotLocation@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "BotLocation@3x.png",
"scale" : "3x"
"filename" : "botlocation.pdf",
"idiom" : "universal"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}

View File

@ -0,0 +1,77 @@
%PDF-1.7
1 0 obj
<< >>
endobj
2 0 obj
<< /Length 3 0 R >>
stream
/DeviceRGB CS
/DeviceRGB cs
q
1.000000 0.000000 -0.000000 1.000000 1.000000 0.000000 cm
0.000000 0.000000 0.000000 scn
4.000000 0.000000 m
4.209139 0.000000 8.000000 2.790861 8.000000 6.000000 c
8.000000 8.209139 6.209139 10.000000 4.000000 10.000000 c
1.790861 10.000000 0.000000 8.209139 0.000000 6.000000 c
0.000000 2.790861 3.790861 0.000000 4.000000 0.000000 c
h
4.000000 4.500000 m
4.828427 4.500000 5.500000 5.171573 5.500000 6.000000 c
5.500000 6.828427 4.828427 7.500000 4.000000 7.500000 c
3.171573 7.500000 2.500000 6.828427 2.500000 6.000000 c
2.500000 5.171573 3.171573 4.500000 4.000000 4.500000 c
h
f*
n
Q
endstream
endobj
3 0 obj
621
endobj
4 0 obj
<< /Annots []
/Type /Page
/MediaBox [ 0.000000 0.000000 10.000000 10.000000 ]
/Resources 1 0 R
/Contents 2 0 R
/Parent 5 0 R
>>
endobj
5 0 obj
<< /Kids [ 4 0 R ]
/Count 1
/Type /Pages
>>
endobj
6 0 obj
<< /Pages 5 0 R
/Type /Catalog
>>
endobj
xref
0 7
0000000000 65535 f
0000000010 00000 n
0000000034 00000 n
0000000711 00000 n
0000000733 00000 n
0000000906 00000 n
0000000980 00000 n
trailer
<< /ID [ (some) (id) ]
/Root 6 0 R
/Size 7
>>
startxref
1039
%%EOF

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -1,22 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "BotMessage@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "BotMessage@3x.png",
"scale" : "3x"
"filename" : "botmessage.pdf",
"idiom" : "universal"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}

View File

@ -0,0 +1,146 @@
%PDF-1.7
1 0 obj
<< /Type /XObject
/Length 2 0 R
/Group << /Type /Group
/S /Transparency
>>
/Subtype /Form
/Resources << >>
/BBox [ 0.000000 0.000000 10.000000 10.000000 ]
>>
stream
/DeviceRGB CS
/DeviceRGB cs
q
1.000000 0.000000 -0.000000 1.000000 0.000000 -0.067810 cm
0.000000 0.000000 0.000000 scn
5.000000 10.067810 m
7.761424 10.067810 10.000000 8.032742 10.000000 5.522356 c
10.000000 3.011971 7.761424 0.976902 5.000000 0.976902 c
4.576631 0.976902 4.165551 1.024737 3.772944 1.114788 c
3.608864 1.152423 3.395684 0.726701 2.633157 0.299067 c
2.099883 0.000000 1.361029 0.025946 1.235985 0.078396 c
1.033161 0.163471 1.437598 0.390721 1.761992 0.887999 c
2.086386 1.385276 1.952343 1.977291 1.806809 2.083839 c
1.600757 2.234695 1.410087 2.396711 1.235985 2.569399 c
0.448528 3.350461 0.000000 4.349841 0.000000 5.522356 c
0.000000 8.032742 2.238576 10.067810 5.000000 10.067810 c
h
f
n
Q
endstream
endobj
2 0 obj
715
endobj
3 0 obj
<< /Type /XObject
/Length 4 0 R
/Group << /Type /Group
/S /Transparency
>>
/Subtype /Form
/Resources << >>
/BBox [ 0.000000 0.000000 10.000000 10.000000 ]
>>
stream
/DeviceRGB CS
/DeviceRGB cs
q
1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm
0.000000 0.000000 0.000000 scn
0.000000 10.000000 m
10.000000 10.000000 l
10.000000 0.000000 l
0.000000 0.000000 l
0.000000 10.000000 l
h
f
n
Q
endstream
endobj
4 0 obj
232
endobj
5 0 obj
<< /XObject << /X1 1 0 R >>
/ExtGState << /E1 << /SMask << /Type /Mask
/G 3 0 R
/S /Alpha
>>
/Type /ExtGState
>> >>
>>
endobj
6 0 obj
<< /Length 7 0 R >>
stream
/DeviceRGB CS
/DeviceRGB cs
q
/E1 gs
/X1 Do
Q
endstream
endobj
7 0 obj
46
endobj
8 0 obj
<< /Annots []
/Type /Page
/MediaBox [ 0.000000 0.000000 10.000000 10.000000 ]
/Resources 5 0 R
/Contents 6 0 R
/Parent 9 0 R
>>
endobj
9 0 obj
<< /Kids [ 8 0 R ]
/Count 1
/Type /Pages
>>
endobj
10 0 obj
<< /Pages 9 0 R
/Type /Catalog
>>
endobj
xref
0 11
0000000000 65535 f
0000000010 00000 n
0000000973 00000 n
0000000995 00000 n
0000001475 00000 n
0000001497 00000 n
0000001795 00000 n
0000001897 00000 n
0000001918 00000 n
0000002091 00000 n
0000002165 00000 n
trailer
<< /ID [ (some) (id) ]
/Root 10 0 R
/Size 11
>>
startxref
2225
%%EOF

View File

@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "card.pdf",
"filename" : "botcreditcard.pdf",
"idiom" : "universal"
}
],

View File

@ -0,0 +1,87 @@
%PDF-1.7
1 0 obj
<< >>
endobj
2 0 obj
<< /Length 3 0 R >>
stream
/DeviceRGB CS
/DeviceRGB cs
q
1.000000 0.000000 -0.000000 1.000000 0.000000 1.000000 cm
0.000000 0.000000 0.000000 scn
0.163490 7.180986 m
0.000000 6.860118 0.000000 6.440079 0.000000 5.600000 c
0.000000 4.000000 l
10.000000 4.000000 l
10.000000 5.600000 l
10.000000 6.440079 10.000000 6.860118 9.836510 7.180986 c
9.692699 7.463229 9.463229 7.692700 9.180985 7.836510 c
8.860118 8.000000 8.440079 8.000000 7.600000 8.000000 c
2.400000 8.000000 l
1.559921 8.000000 1.139882 8.000000 0.819014 7.836510 c
0.536771 7.692700 0.307300 7.463229 0.163490 7.180986 c
h
9.999153 2.000000 m
0.000847 2.000000 l
0.004894 1.417536 0.028288 1.084363 0.163490 0.819014 c
0.307300 0.536771 0.536771 0.307300 0.819014 0.163490 c
1.139882 0.000000 1.559921 0.000000 2.400000 0.000000 c
7.600000 0.000000 l
8.440079 0.000000 8.860118 0.000000 9.180985 0.163490 c
9.463229 0.307300 9.692699 0.536771 9.836510 0.819014 c
9.971712 1.084363 9.995106 1.417536 9.999153 2.000000 c
h
f*
n
Q
endstream
endobj
3 0 obj
966
endobj
4 0 obj
<< /Annots []
/Type /Page
/MediaBox [ 0.000000 0.000000 10.000000 10.000000 ]
/Resources 1 0 R
/Contents 2 0 R
/Parent 5 0 R
>>
endobj
5 0 obj
<< /Kids [ 4 0 R ]
/Count 1
/Type /Pages
>>
endobj
6 0 obj
<< /Pages 5 0 R
/Type /Catalog
>>
endobj
xref
0 7
0000000000 65535 f
0000000010 00000 n
0000000034 00000 n
0000001056 00000 n
0000001078 00000 n
0000001251 00000 n
0000001325 00000 n
trailer
<< /ID [ (some) (id) ]
/Root 6 0 R
/Size 7
>>
startxref
1384
%%EOF

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -1,22 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "BotPhone@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "BotPhone@3x.png",
"scale" : "3x"
"filename" : "botsimcard.pdf",
"idiom" : "universal"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}

View File

@ -0,0 +1,105 @@
%PDF-1.7
1 0 obj
<< >>
endobj
2 0 obj
<< /Length 3 0 R >>
stream
/DeviceRGB CS
/DeviceRGB cs
q
1.000000 0.000000 -0.000000 1.000000 1.000000 0.000000 cm
0.000000 0.000000 0.000000 scn
5.600000 0.000000 m
2.400000 0.000000 l
1.559921 0.000000 1.139882 0.000000 0.819014 0.163490 c
0.536771 0.307301 0.307300 0.536771 0.163490 0.819015 c
0.000000 1.139882 0.000000 1.559921 0.000000 2.400000 c
0.000000 7.600000 l
0.000000 8.440079 0.000000 8.860118 0.163490 9.180985 c
0.307300 9.463229 0.536771 9.692699 0.819014 9.836510 c
1.139882 10.000000 1.559921 10.000000 2.400000 10.000000 c
3.174517 10.000000 l
3.663698 10.000000 3.908288 10.000000 4.138463 9.944740 c
4.342536 9.895746 4.537625 9.814938 4.716570 9.705280 c
4.918403 9.581596 5.091355 9.408646 5.437258 9.062742 c
7.062742 7.437258 l
7.408645 7.091355 7.581597 6.918403 7.705280 6.716570 c
7.814938 6.537625 7.895746 6.342536 7.944740 6.138464 c
8.000000 5.908288 8.000000 5.663698 8.000000 5.174517 c
8.000000 2.400000 l
8.000000 1.559921 8.000000 1.139882 7.836510 0.819015 c
7.692700 0.536771 7.463229 0.307301 7.180986 0.163490 c
6.860118 0.000000 6.440079 0.000000 5.600000 0.000000 c
h
1.608990 4.953990 m
1.499996 4.740078 1.499996 4.460052 1.499996 3.900000 c
1.499996 3.099999 l
1.499996 2.539947 1.499996 2.259921 1.608990 2.046009 c
1.704863 1.857847 1.857844 1.704866 2.046006 1.608993 c
2.259917 1.500000 2.539944 1.500000 3.099996 1.500000 c
4.899996 1.500000 l
5.460049 1.500000 5.740075 1.500000 5.953987 1.608993 c
6.142149 1.704866 6.295129 1.857847 6.391003 2.046009 c
6.499996 2.259921 6.499996 2.539947 6.499996 3.099999 c
6.499996 3.900000 l
6.499996 4.460052 6.499996 4.740078 6.391003 4.953990 c
6.295129 5.142152 6.142149 5.295133 5.953987 5.391006 c
5.740075 5.500000 5.460049 5.500000 4.899996 5.500000 c
3.099996 5.500000 l
2.539944 5.500000 2.259917 5.500000 2.046006 5.391006 c
1.857844 5.295133 1.704863 5.142152 1.608990 4.953990 c
h
f*
n
Q
endstream
endobj
3 0 obj
1868
endobj
4 0 obj
<< /Annots []
/Type /Page
/MediaBox [ 0.000000 0.000000 10.000000 10.000000 ]
/Resources 1 0 R
/Contents 2 0 R
/Parent 5 0 R
>>
endobj
5 0 obj
<< /Kids [ 4 0 R ]
/Count 1
/Type /Pages
>>
endobj
6 0 obj
<< /Pages 5 0 R
/Type /Catalog
>>
endobj
xref
0 7
0000000000 65535 f
0000000010 00000 n
0000000034 00000 n
0000001958 00000 n
0000001981 00000 n
0000002154 00000 n
0000002228 00000 n
trailer
<< /ID [ (some) (id) ]
/Root 6 0 R
/Size 7
>>
startxref
2287
%%EOF

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -1,17 +1,8 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "BotMessage@3x.png",
"idiom" : "universal",
"scale" : "3x"
"filename" : "botprofile (1).pdf",
"idiom" : "universal"
}
],
"info" : {

View File

@ -0,0 +1,87 @@
%PDF-1.7
1 0 obj
<< >>
endobj
2 0 obj
<< /Length 3 0 R >>
stream
/DeviceRGB CS
/DeviceRGB cs
q
1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm
0.000000 0.000000 0.000000 scn
10.000000 5.000000 m
10.000000 2.238576 7.761424 0.000000 5.000000 0.000000 c
2.238576 0.000000 0.000000 2.238576 0.000000 5.000000 c
0.000000 7.761424 2.238576 10.000000 5.000000 10.000000 c
7.761424 10.000000 10.000000 7.761424 10.000000 5.000000 c
h
7.693560 2.871713 m
7.055479 3.417237 6.157626 3.689999 4.999999 3.689999 c
3.843426 3.689999 2.946154 3.417733 2.307761 2.873090 c
2.298760 2.865411 2.289426 2.857153 2.279822 2.848403 c
2.019047 2.610812 2.037121 2.187978 2.309236 1.963464 c
3.040504 1.360117 3.977927 0.997691 4.999999 0.997691 c
6.022901 0.997691 6.961017 1.360706 7.692426 1.965061 c
7.963211 2.188808 7.981247 2.609582 7.721957 2.846554 c
7.712191 2.855480 7.702703 2.863896 7.693560 2.871713 c
h
6.538462 6.153847 m
6.538462 7.003516 5.849669 7.692309 5.000000 7.692309 c
4.150331 7.692309 3.461539 7.003516 3.461539 6.153847 c
3.461539 5.304178 4.150331 4.615386 5.000000 4.615386 c
5.849669 4.615386 6.538462 5.304178 6.538462 6.153847 c
h
f*
n
Q
endstream
endobj
3 0 obj
1095
endobj
4 0 obj
<< /Annots []
/Type /Page
/MediaBox [ 0.000000 0.000000 10.000000 10.000000 ]
/Resources 1 0 R
/Contents 2 0 R
/Parent 5 0 R
>>
endobj
5 0 obj
<< /Kids [ 4 0 R ]
/Count 1
/Type /Pages
>>
endobj
6 0 obj
<< /Pages 5 0 R
/Type /Catalog
>>
endobj
xref
0 7
0000000000 65535 f
0000000010 00000 n
0000000034 00000 n
0000001185 00000 n
0000001208 00000 n
0000001381 00000 n
0000001455 00000 n
trailer
<< /ID [ (some) (id) ]
/Root 6 0 R
/Size 7
>>
startxref
1514
%%EOF

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -1,22 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "BotShare@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "BotShare@3x.png",
"scale" : "3x"
"filename" : "botshare.pdf",
"idiom" : "universal"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}

View File

@ -0,0 +1,154 @@
%PDF-1.7
1 0 obj
<< /Type /XObject
/Length 2 0 R
/Group << /Type /Group
/S /Transparency
>>
/Subtype /Form
/Resources << >>
/BBox [ 0.000000 0.000000 10.000000 10.000000 ]
>>
stream
/DeviceRGB CS
/DeviceRGB cs
q
1.000000 0.000000 -0.000000 1.000000 0.000000 1.697514 cm
0.000000 0.000000 0.000000 scn
5.152984 5.102487 m
5.152984 5.968138 l
5.152984 6.547595 5.152984 6.837323 5.269190 6.976490 c
5.370099 7.097338 5.522033 7.163600 5.679254 7.155328 c
5.860308 7.145803 6.072636 6.948676 6.497293 6.554421 c
9.368506 3.888769 l
9.587912 3.685072 9.697614 3.583224 9.738306 3.464036 c
9.774062 3.359304 9.774062 3.245669 9.738306 3.140937 c
9.697614 3.021749 9.587911 2.919900 9.368506 2.716203 c
6.497293 0.050551 l
6.072636 -0.343703 5.860308 -0.540830 5.679254 -0.550356 c
5.522033 -0.558627 5.370099 -0.492365 5.269190 -0.371517 c
5.152984 -0.232350 5.152984 0.057378 5.152984 0.636834 c
5.152984 1.502486 l
2.908304 1.502486 1.549372 0.625330 0.795713 -0.129066 c
0.460085 -0.465023 0.292271 -0.633001 0.213952 -0.636048 c
0.141017 -0.638886 0.084704 -0.611050 0.042670 -0.551378 c
-0.002468 -0.487302 0.025289 -0.280314 0.080801 0.133661 c
0.328706 1.982362 1.315535 5.102487 5.152984 5.102487 c
h
f*
n
Q
endstream
endobj
2 0 obj
1029
endobj
3 0 obj
<< /Type /XObject
/Length 4 0 R
/Group << /Type /Group
/S /Transparency
>>
/Subtype /Form
/Resources << >>
/BBox [ 0.000000 0.000000 10.000000 10.000000 ]
>>
stream
/DeviceRGB CS
/DeviceRGB cs
q
1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm
0.000000 0.000000 0.000000 scn
0.000000 10.000000 m
10.000000 10.000000 l
10.000000 0.000000 l
0.000000 0.000000 l
0.000000 10.000000 l
h
f
n
Q
endstream
endobj
4 0 obj
232
endobj
5 0 obj
<< /XObject << /X1 1 0 R >>
/ExtGState << /E1 << /SMask << /Type /Mask
/G 3 0 R
/S /Alpha
>>
/Type /ExtGState
>> >>
>>
endobj
6 0 obj
<< /Length 7 0 R >>
stream
/DeviceRGB CS
/DeviceRGB cs
q
/E1 gs
/X1 Do
Q
endstream
endobj
7 0 obj
46
endobj
8 0 obj
<< /Annots []
/Type /Page
/MediaBox [ 0.000000 0.000000 10.000000 10.000000 ]
/Resources 5 0 R
/Contents 6 0 R
/Parent 9 0 R
>>
endobj
9 0 obj
<< /Kids [ 8 0 R ]
/Count 1
/Type /Pages
>>
endobj
10 0 obj
<< /Pages 9 0 R
/Type /Catalog
>>
endobj
xref
0 11
0000000000 65535 f
0000000010 00000 n
0000001287 00000 n
0000001310 00000 n
0000001790 00000 n
0000001812 00000 n
0000002110 00000 n
0000002212 00000 n
0000002233 00000 n
0000002406 00000 n
0000002480 00000 n
trailer
<< /ID [ (some) (id) ]
/Root 10 0 R
/Size 11
>>
startxref
2540
%%EOF

View File

@ -1544,7 +1544,7 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
callKitIntegration.reportIncomingCall(
uuid: CallSessionManager.getStableIncomingUUID(stableId: callUpdate.callId),
stableId: callUpdate.callId,
handle: "\(callUpdate.peer.id.id)",
handle: "\(callUpdate.peer.id.id._internalGetInt64Value())",
isVideo: false,
displayTitle: callUpdate.peer.debugDisplayTitle,
completion: { error in

View File

@ -279,7 +279,7 @@ private final class PeerInfoScreenLabeledValueItemNode: PeerInfoScreenItemNode {
let labelFrame = CGRect(origin: CGPoint(x: sideInset, y: 11.0), size: labelSize)
let textFrame = CGRect(origin: CGPoint(x: sideInset, y: labelFrame.maxY + 3.0), size: textSize)
let expandFrame = CGRect(origin: CGPoint(x: textFrame.minX + max(self.textNode.trailingLineWidth ?? 0.0, textFrame.width) - expandSize.width, y: textFrame.maxY - expandSize.height), size: expandSize)
let expandFrame = CGRect(origin: CGPoint(x: width - safeInsets.right - expandSize.width - 14.0 - UIScreenPixel, y: textFrame.maxY - expandSize.height - 1.0), size: expandSize)
self.expandNode.frame = expandFrame
self.expandButonNode.frame = expandFrame.insetBy(dx: -8.0, dy: -8.0)

View File

@ -1,4 +1,5 @@
import AsyncDisplayKit
import AVFoundation
import Display
import TelegramCore
import SwiftSignalKit
@ -770,7 +771,23 @@ private final class DurationLayer: CALayer {
}
}
private final class ItemLayer: CALayer, SparseItemGridLayer {
private protocol ItemLayer: SparseItemGridLayer {
var item: VisualMediaItem? { get set }
var durationLayer: DurationLayer? { get set }
var minFactor: CGFloat { get set }
var selectionLayer: GridMessageSelectionLayer? { get set }
var disposable: Disposable? { get set }
var hasContents: Bool { get set }
func updateDuration(duration: Int32?, isMin: Bool, minFactor: CGFloat)
func updateSelection(theme: CheckNodeTheme, isSelected: Bool?, animated: Bool)
func bind(item: VisualMediaItem)
func unbind()
}
private final class GenericItemLayer: CALayer, ItemLayer {
var item: VisualMediaItem?
var durationLayer: DurationLayer?
var minFactor: CGFloat = 1.0
@ -792,6 +809,16 @@ private final class ItemLayer: CALayer, SparseItemGridLayer {
deinit {
self.disposable?.dispose()
}
func getContents() -> Any? {
return self.contents
}
func setContents(_ contents: Any?) {
if let image = contents as? UIImage {
self.contents = image.cgImage
}
}
override func action(forKey event: String) -> CAAction? {
return nullAction
@ -865,6 +892,117 @@ private final class ItemLayer: CALayer, SparseItemGridLayer {
}
}
private final class CaptureProtectedItemLayer: AVSampleBufferDisplayLayer, ItemLayer {
var item: VisualMediaItem?
var durationLayer: DurationLayer?
var minFactor: CGFloat = 1.0
var selectionLayer: GridMessageSelectionLayer?
var disposable: Disposable?
var hasContents: Bool = false
override init() {
super.init()
self.contentsGravity = .resize
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
deinit {
self.disposable?.dispose()
}
override func action(forKey event: String) -> CAAction? {
return nullAction
}
private var layerContents: Any?
func getContents() -> Any? {
return self.layerContents
}
func setContents(_ contents: Any?) {
self.layerContents = contents
if let image = contents as? UIImage {
self.layerContents = image.cgImage
if let cmSampleBuffer = image.cmSampleBuffer {
self.enqueue(cmSampleBuffer)
}
}
}
func bind(item: VisualMediaItem) {
self.item = item
}
func updateDuration(duration: Int32?, isMin: Bool, minFactor: CGFloat) {
self.minFactor = minFactor
if let duration = duration {
if let durationLayer = self.durationLayer {
durationLayer.update(duration: duration, isMin: isMin)
} else {
let durationLayer = DurationLayer()
durationLayer.update(duration: duration, isMin: isMin)
self.addSublayer(durationLayer)
durationLayer.frame = CGRect(origin: CGPoint(x: self.bounds.width - 3.0, y: self.bounds.height - 3.0), size: CGSize())
durationLayer.transform = CATransform3DMakeScale(minFactor, minFactor, 1.0)
self.durationLayer = durationLayer
}
} else if let durationLayer = self.durationLayer {
self.durationLayer = nil
durationLayer.removeFromSuperlayer()
}
}
func updateSelection(theme: CheckNodeTheme, isSelected: Bool?, animated: Bool) {
if let isSelected = isSelected {
if let selectionLayer = self.selectionLayer {
selectionLayer.updateSelected(isSelected, animated: animated)
} else {
let selectionLayer = GridMessageSelectionLayer(theme: theme)
selectionLayer.updateSelected(isSelected, animated: false)
self.selectionLayer = selectionLayer
self.addSublayer(selectionLayer)
if !self.bounds.isEmpty {
selectionLayer.frame = CGRect(origin: CGPoint(), size: self.bounds.size)
selectionLayer.updateLayout(size: self.bounds.size)
if animated {
selectionLayer.animateIn()
}
}
}
} else if let selectionLayer = self.selectionLayer {
self.selectionLayer = nil
if animated {
selectionLayer.animateOut { [weak selectionLayer] in
selectionLayer?.removeFromSuperlayer()
}
} else {
selectionLayer.removeFromSuperlayer()
}
}
}
func unbind() {
self.item = nil
}
func needsShimmer() -> Bool {
return !self.hasContents
}
func update(size: CGSize) {
/*if let durationLayer = self.durationLayer {
durationLayer.frame = CGRect(origin: CGPoint(x: size.width - 3.0, y: size.height - 3.0), size: CGSize())
}*/
}
}
private final class ItemView: UIView, SparseItemGridView {
var item: VisualMediaItem?
var disposable: Disposable?
@ -1037,6 +1175,7 @@ private final class SparseItemGridBindingImpl: SparseItemGridBinding, ListShimme
let context: AccountContext
let chatLocation: ChatLocation
let directMediaImageCache: DirectMediaImageCache
let captureProtected: Bool
var strings: PresentationStrings
let useListItems: Bool
let listItemInteraction: ListMessageItemInteraction
@ -1055,13 +1194,14 @@ private final class SparseItemGridBindingImpl: SparseItemGridBinding, ListShimme
private var shimmerImages: [CGFloat: UIImage] = [:]
init(context: AccountContext, chatLocation: ChatLocation, useListItems: Bool, listItemInteraction: ListMessageItemInteraction, chatControllerInteraction: ChatControllerInteraction, directMediaImageCache: DirectMediaImageCache) {
init(context: AccountContext, chatLocation: ChatLocation, useListItems: Bool, listItemInteraction: ListMessageItemInteraction, chatControllerInteraction: ChatControllerInteraction, directMediaImageCache: DirectMediaImageCache, captureProtected: Bool) {
self.context = context
self.chatLocation = chatLocation
self.useListItems = useListItems
self.listItemInteraction = listItemInteraction
self.chatControllerInteraction = chatControllerInteraction
self.directMediaImageCache = directMediaImageCache
self.captureProtected = captureProtected
let presentationData = self.context.sharedContext.currentPresentationData.with { $0 }
self.strings = presentationData.strings
@ -1174,7 +1314,11 @@ private final class SparseItemGridBindingImpl: SparseItemGridBinding, ListShimme
if self.useListItems {
return nil
}
return ItemLayer()
if self.captureProtected {
return CaptureProtectedItemLayer()
} else {
return GenericItemLayer()
}
}
func createView() -> SparseItemGridView? {
@ -1256,7 +1400,7 @@ private final class SparseItemGridBindingImpl: SparseItemGridBinding, ListShimme
if let selectedMedia = selectedMedia {
if let result = directMediaImageCache.getImage(message: message, media: selectedMedia, width: imageWidthSpec, possibleWidths: SparseItemGridBindingImpl.widthSpecs.1, synchronous: synchronous == .full) {
if let image = result.image {
layer.contents = image.cgImage
layer.setContents(image)
switch synchronous {
case .none:
layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2, completion: { [weak self, weak layer, weak displayItem] _ in
@ -1286,9 +1430,9 @@ private final class SparseItemGridBindingImpl: SparseItemGridBinding, ListShimme
synchronousValue = deltaTime < 0.1
}
if layer.contents != nil && !synchronousValue {
let copyLayer = ItemLayer()
copyLayer.contents = layer.contents
if let contents = layer.getContents(), !synchronousValue {
let copyLayer = GenericItemLayer()
copyLayer.contents = contents
copyLayer.contentsRect = layer.contentsRect
copyLayer.frame = layer.bounds
if let durationLayer = layer.durationLayer {
@ -1300,14 +1444,13 @@ private final class SparseItemGridBindingImpl: SparseItemGridBinding, ListShimme
copyLayer?.removeFromSuperlayer()
})
layer.contents = image?.cgImage
layer.setContents(image)
layer.hasContents = true
if let displayItem = displayItem {
self?.updateShimmerLayersImpl?(displayItem)
}
} else {
layer.contents = image?.cgImage
layer.setContents(image)
if !synchronousValue {
layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2, completion: { [weak layer] _ in
@ -1510,7 +1653,7 @@ final class PeerInfoVisualMediaPaneNode: ASDisplayNode, PeerInfoPaneNode, UIScro
private var presentationData: PresentationData
private var presentationDataDisposable: Disposable?
init(context: AccountContext, chatControllerInteraction: ChatControllerInteraction, peerId: PeerId, contentType: ContentType) {
init(context: AccountContext, chatControllerInteraction: ChatControllerInteraction, peerId: PeerId, contentType: ContentType, captureProtected: Bool) {
self.context = context
self.peerId = peerId
self.chatControllerInteraction = chatControllerInteraction
@ -1562,7 +1705,8 @@ final class PeerInfoVisualMediaPaneNode: ASDisplayNode, PeerInfoPaneNode, UIScro
useListItems: useListItems,
listItemInteraction: listItemInteraction,
chatControllerInteraction: chatControllerInteraction,
directMediaImageCache: self.directMediaImageCache
directMediaImageCache: self.directMediaImageCache,
captureProtected: captureProtected
)
self.listSource = self.context.engine.messages.sparseMessageList(peerId: self.peerId, tag: tagMaskForType(self.contentType))
@ -1787,20 +1931,6 @@ final class PeerInfoVisualMediaPaneNode: ASDisplayNode, PeerInfoPaneNode, UIScro
}
let rect = strongSelf.itemGrid.frameForItem(layer: itemLayer)
/*let proxyNode = ASDisplayNode()
proxyNode.frame = rect
proxyNode.contents = itemLayer.contents
proxyNode.isHidden = true
strongSelf.addSubnode(proxyNode)
let escapeNotification = EscapeNotification {
proxyNode.removeFromSupernode()
}
Queue.mainQueue().after(1.0, {
escapeNotification.keep()
})*/
strongSelf.chatControllerInteraction.openMessageContextActions(message, strongSelf, rect, gesture)
strongSelf.itemGrid.cancelGestures()
@ -2209,7 +2339,13 @@ final class PeerInfoVisualMediaPaneNode: ASDisplayNode, PeerInfoPaneNode, UIScro
let itemFrame = self.view.convert(self.itemGrid.frameForItem(layer: itemLayer), from: self.itemGrid.view)
let proxyNode = ASDisplayNode()
proxyNode.frame = itemFrame
proxyNode.contents = itemLayer.contents
if let contents = itemLayer.getContents() {
if let image = contents as? UIImage {
proxyNode.contents = image.cgImage
} else {
proxyNode.contents = contents
}
}
proxyNode.isHidden = true
self.addSubnode(proxyNode)

View File

@ -392,10 +392,11 @@ private final class PeerInfoPendingPane {
openMediaCalendar: @escaping () -> Void,
paneDidScroll: @escaping () -> Void
) {
let captureProtected = data.peer?.isCopyProtectionEnabled ?? false
let paneNode: PeerInfoPaneNode
switch key {
case .media:
let visualPaneNode = PeerInfoVisualMediaPaneNode(context: context, chatControllerInteraction: chatControllerInteraction, peerId: peerId, contentType: .photoOrVideo)
let visualPaneNode = PeerInfoVisualMediaPaneNode(context: context, chatControllerInteraction: chatControllerInteraction, peerId: peerId, contentType: .photoOrVideo, captureProtected: captureProtected)
paneNode = visualPaneNode
visualPaneNode.openCurrentDate = {
openMediaCalendar()
@ -404,17 +405,17 @@ private final class PeerInfoPendingPane {
paneDidScroll()
}
case .files:
let visualPaneNode = PeerInfoVisualMediaPaneNode(context: context, chatControllerInteraction: chatControllerInteraction, peerId: peerId, contentType: .files)
let visualPaneNode = PeerInfoVisualMediaPaneNode(context: context, chatControllerInteraction: chatControllerInteraction, peerId: peerId, contentType: .files, captureProtected: captureProtected)
paneNode = visualPaneNode
//paneNode = PeerInfoListPaneNode(context: context, updatedPresentationData: updatedPresentationData, chatControllerInteraction: chatControllerInteraction, peerId: peerId, tagMask: .file)
case .links:
paneNode = PeerInfoListPaneNode(context: context, updatedPresentationData: updatedPresentationData, chatControllerInteraction: chatControllerInteraction, peerId: peerId, tagMask: .webPage)
case .voice:
let visualPaneNode = PeerInfoVisualMediaPaneNode(context: context, chatControllerInteraction: chatControllerInteraction, peerId: peerId, contentType: .voiceAndVideoMessages)
let visualPaneNode = PeerInfoVisualMediaPaneNode(context: context, chatControllerInteraction: chatControllerInteraction, peerId: peerId, contentType: .voiceAndVideoMessages, captureProtected: captureProtected)
paneNode = visualPaneNode
//paneNode = PeerInfoListPaneNode(context: context, updatedPresentationData: updatedPresentationData, chatControllerInteraction: chatControllerInteraction, peerId: peerId, tagMask: .voiceOrInstantVideo)
case .music:
let visualPaneNode = PeerInfoVisualMediaPaneNode(context: context, chatControllerInteraction: chatControllerInteraction, peerId: peerId, contentType: .music)
let visualPaneNode = PeerInfoVisualMediaPaneNode(context: context, chatControllerInteraction: chatControllerInteraction, peerId: peerId, contentType: .music, captureProtected: captureProtected)
paneNode = visualPaneNode
//paneNode = PeerInfoListPaneNode(context: context, updatedPresentationData: updatedPresentationData, chatControllerInteraction: chatControllerInteraction, peerId: peerId, tagMask: .music)
case .gifs:

View File

@ -2345,7 +2345,7 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewDelegate
}
let entriesPromise = Promise<[AvatarGalleryEntry]>(entries)
let galleryController = AvatarGalleryController(context: strongSelf.context, peer: peer, sourceCorners: .round(!strongSelf.headerNode.isAvatarExpanded), remoteEntries: entriesPromise, skipInitial: true, centralEntryIndex: centralEntry.flatMap { entries.firstIndex(of: $0) }, replaceRootController: { controller, ready in
let galleryController = AvatarGalleryController(context: strongSelf.context, peer: peer, sourceCorners: .round, remoteEntries: entriesPromise, skipInitial: true, centralEntryIndex: centralEntry.flatMap { entries.firstIndex(of: $0) }, replaceRootController: { controller, ready in
})
galleryController.openAvatarSetup = { [weak self] completion in
self?.openAvatarForEditing(fromGallery: true, completion: completion)

View File

@ -875,8 +875,11 @@ final class PeerInfoGifPaneNode: ASDisplayNode, PeerInfoPaneNode, UIScrollViewDe
animationTimer.start()
self.statusPromise.set(context.account.postbox.combinedView(keys: [PostboxViewKey.historyTagSummaryView(tag: tagMaskForType(self.contentType), peerId: peerId, namespace: Namespaces.Message.Cloud)])
|> map { views -> PeerInfoStatusData? in
let count: Int32 = (views.views[PostboxViewKey.historyTagSummaryView(tag: tagMaskForType(self.contentType), peerId: peerId, namespace: Namespaces.Message.Cloud)] as? MessageHistoryTagSummaryView)?.count ?? 0
|> map { [weak self] views -> PeerInfoStatusData? in
guard let strongSelf = self else {
return nil
}
let count: Int32 = (views.views[PostboxViewKey.historyTagSummaryView(tag: tagMaskForType(strongSelf.contentType), peerId: peerId, namespace: Namespaces.Message.Cloud)] as? MessageHistoryTagSummaryView)?.count ?? 0
if count == 0 {
return nil
}