mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix reporting video avatar
This commit is contained in:
parent
efaffc6459
commit
30a8e5eda6
@ -2773,18 +2773,18 @@ private final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewD
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
screenData = peerInfoScreenData(context: context, peerId: peerId, strings: self.presentationData.strings, dateTimeFormat: self.presentationData.dateTimeFormat, isSettings: self.isSettings, ignoreGroupInCommon: ignoreGroupInCommon)
|
screenData = peerInfoScreenData(context: context, peerId: peerId, strings: self.presentationData.strings, dateTimeFormat: self.presentationData.dateTimeFormat, isSettings: self.isSettings, ignoreGroupInCommon: ignoreGroupInCommon)
|
||||||
|
|
||||||
var currentIsVideo = false
|
|
||||||
let item = self.headerNode.avatarListNode.listContainerNode.currentItemNode?.item
|
|
||||||
if let item = item, case let .image(image) = item {
|
|
||||||
currentIsVideo = !image.2.isEmpty
|
|
||||||
}
|
|
||||||
|
|
||||||
self.headerNode.displayAvatarContextMenu = { [weak self] node, gesture in
|
self.headerNode.displayAvatarContextMenu = { [weak self] node, gesture in
|
||||||
guard let strongSelf = self, let peer = strongSelf.data?.peer else {
|
guard let strongSelf = self, let peer = strongSelf.data?.peer else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var currentIsVideo = false
|
||||||
|
let item = strongSelf.headerNode.avatarListNode.listContainerNode.currentItemNode?.item
|
||||||
|
if let item = item, case let .image(image) = item {
|
||||||
|
currentIsVideo = !image.2.isEmpty
|
||||||
|
}
|
||||||
|
|
||||||
let items: [ContextMenuItem] = [
|
let items: [ContextMenuItem] = [
|
||||||
.action(ContextMenuActionItem(text: currentIsVideo ? strongSelf.presentationData.strings.PeerInfo_ReportProfileVideo : strongSelf.presentationData.strings.PeerInfo_ReportProfilePhoto, icon: { theme in
|
.action(ContextMenuActionItem(text: currentIsVideo ? strongSelf.presentationData.strings.PeerInfo_ReportProfileVideo : strongSelf.presentationData.strings.PeerInfo_ReportProfilePhoto, icon: { theme in
|
||||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Report"), color: theme.actionSheet.primaryTextColor)
|
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Report"), color: theme.actionSheet.primaryTextColor)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user