mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Add Send When Online shortcut
This commit is contained in:
@@ -117,6 +117,12 @@ public extension AttachmentContainable {
|
||||
}
|
||||
|
||||
public enum AttachmentMediaPickerSendMode {
|
||||
case generic
|
||||
case silently
|
||||
case whenOnline
|
||||
}
|
||||
|
||||
public enum AttachmentMediaPickerAttachmentMode {
|
||||
case media
|
||||
case files
|
||||
}
|
||||
@@ -131,7 +137,7 @@ public protocol AttachmentMediaPickerContext {
|
||||
func mainButtonAction()
|
||||
|
||||
func setCaption(_ caption: NSAttributedString)
|
||||
func send(silently: Bool, mode: AttachmentMediaPickerSendMode)
|
||||
func send(mode: AttachmentMediaPickerSendMode, attachmentMode: AttachmentMediaPickerAttachmentMode)
|
||||
func schedule()
|
||||
}
|
||||
|
||||
@@ -380,12 +386,14 @@ public class AttachmentController: ViewController {
|
||||
self.panel.sendMessagePressed = { [weak self] mode in
|
||||
if let strongSelf = self {
|
||||
switch mode {
|
||||
case .generic:
|
||||
strongSelf.mediaPickerContext?.send(silently: false, mode: .media)
|
||||
case .silent:
|
||||
strongSelf.mediaPickerContext?.send(silently: true, mode: .media)
|
||||
case .schedule:
|
||||
strongSelf.mediaPickerContext?.schedule()
|
||||
case .generic:
|
||||
strongSelf.mediaPickerContext?.send(mode: .generic, attachmentMode: .media)
|
||||
case .silent:
|
||||
strongSelf.mediaPickerContext?.send(mode: .silently, attachmentMode: .media)
|
||||
case .schedule:
|
||||
strongSelf.mediaPickerContext?.schedule()
|
||||
case .whenOnline:
|
||||
strongSelf.mediaPickerContext?.send(mode: .whenOnline, attachmentMode: .media)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user