mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Disable message image sharing
This commit is contained in:
parent
26f6e04fb3
commit
97f224f0a8
@ -685,7 +685,7 @@ public final class ShareController: ViewController {
|
||||
|> take(1)
|
||||
}
|
||||
}
|
||||
self.controllerNode.shareExternal = { [weak self] asImage in
|
||||
self.controllerNode.shareExternal = { [weak self] _ in
|
||||
if let strongSelf = self {
|
||||
var collectableItems: [CollectableExternalShareItem] = []
|
||||
var subject = strongSelf.subject
|
||||
@ -694,7 +694,7 @@ public final class ShareController: ViewController {
|
||||
subject = selectedValue.subject
|
||||
}
|
||||
var messageUrl: String?
|
||||
var messagesToShare: [Message]?
|
||||
// var messagesToShare: [Message]?
|
||||
switch subject {
|
||||
case let .url(text):
|
||||
collectableItems.append(CollectableExternalShareItem(url: explicitUrl(text), text: "", author: nil, timestamp: nil, mediaReference: nil))
|
||||
@ -711,7 +711,7 @@ public final class ShareController: ViewController {
|
||||
let latLong = "\(media.latitude),\(media.longitude)"
|
||||
collectableItems.append(CollectableExternalShareItem(url: "https://maps.apple.com/maps?ll=\(latLong)&q=\(latLong)&t=m", text: "", author: nil, timestamp: nil, mediaReference: nil))
|
||||
case let .messages(messages):
|
||||
messagesToShare = messages
|
||||
// messagesToShare = messages
|
||||
for message in messages {
|
||||
var url: String?
|
||||
var selectedMedia: Media?
|
||||
@ -801,16 +801,16 @@ public final class ShareController: ViewController {
|
||||
|> filter { $0 }
|
||||
|> take(1)
|
||||
|> deliverOnMainQueue).start(next: { [weak self] _ in
|
||||
if asImage, let messages = messagesToShare {
|
||||
self?.openShareAsImage?(messages)
|
||||
} else {
|
||||
// if asImage, let messages = messagesToShare {
|
||||
// self?.openShareAsImage?(messages)
|
||||
// } else {
|
||||
let activityController = UIActivityViewController(activityItems: activityItems, applicationActivities: activities)
|
||||
if let strongSelf = self, let window = strongSelf.view.window, let rootViewController = window.rootViewController {
|
||||
activityController.popoverPresentationController?.sourceView = window
|
||||
activityController.popoverPresentationController?.sourceRect = CGRect(origin: CGPoint(x: window.bounds.width / 2.0, y: window.bounds.size.height - 1.0), size: CGSize(width: 1.0, height: 1.0))
|
||||
rootViewController.present(activityController, animated: true, completion: nil)
|
||||
}
|
||||
}
|
||||
// }
|
||||
})
|
||||
}
|
||||
return .done
|
||||
|
@ -825,7 +825,7 @@ final class ShareControllerNode: ViewControllerTracingNode, UIScrollViewDelegate
|
||||
}
|
||||
})
|
||||
}
|
||||
let openShare: (Bool, ASDisplayNode?, ContextGesture?) -> Void = { [weak self] reportReady, node, gesture in
|
||||
let openShare: (Bool) -> Void = { [weak self] reportReady in
|
||||
guard let strongSelf = self, let shareExternal = strongSelf.shareExternal else {
|
||||
return
|
||||
}
|
||||
@ -881,7 +881,7 @@ final class ShareControllerNode: ViewControllerTracingNode, UIScrollViewDelegate
|
||||
}
|
||||
}
|
||||
peersContentNode.openShare = { node, gesture in
|
||||
openShare(false, node, gesture)
|
||||
openShare(false)
|
||||
}
|
||||
peersContentNode.segmentedSelectedIndexUpdated = { [weak self] index in
|
||||
if let strongSelf = self, let _ = strongSelf.segmentedValues {
|
||||
@ -890,7 +890,7 @@ final class ShareControllerNode: ViewControllerTracingNode, UIScrollViewDelegate
|
||||
}
|
||||
}
|
||||
if self.immediateExternalShare {
|
||||
openShare(true, nil, nil)
|
||||
openShare(true)
|
||||
} else {
|
||||
self.transitionToContentNode(peersContentNode, animated: animated)
|
||||
self.ready.set(.single(true))
|
||||
|
Loading…
x
Reference in New Issue
Block a user