mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-07 01:10:09 +00:00
Enabled Send When Online option
This commit is contained in:
parent
0d5326959c
commit
f357e5596f
@ -1580,7 +1580,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
if peer.id == strongSelf.context.account.peerId {
|
||||
mode = .reminders
|
||||
} else {
|
||||
mode = .scheduledMessages
|
||||
mode = .scheduledMessages(sendWhenOnlineAvailable: peer.id.namespace == Namespaces.Peer.CloudUser)
|
||||
}
|
||||
|
||||
let controller = ChatScheduleTimeController(context: strongSelf.context, mode: mode, minimalTime: strongSelf.presentationInterfaceState.slowmodeState?.timeout, completion: { [weak self] scheduleTime in
|
||||
@ -1612,7 +1612,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
if peer.id == strongSelf.context.account.peerId {
|
||||
mode = .reminders
|
||||
} else {
|
||||
mode = .scheduledMessages
|
||||
mode = .scheduledMessages(sendWhenOnlineAvailable: peer.id.namespace == Namespaces.Peer.CloudUser)
|
||||
}
|
||||
|
||||
let _ = (strongSelf.context.account.postbox.transaction { transaction -> Message? in
|
||||
@ -5463,7 +5463,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
if peer.id == strongSelf.context.account.peerId {
|
||||
mode = .reminders
|
||||
} else {
|
||||
mode = .scheduledMessages
|
||||
mode = .scheduledMessages(sendWhenOnlineAvailable: peer.id.namespace == Namespaces.Peer.CloudUser)
|
||||
}
|
||||
let controller = ChatScheduleTimeController(context: strongSelf.context, mode: mode, minimalTime: strongSelf.presentationInterfaceState.slowmodeState?.timeout, completion: { [weak self] time in
|
||||
if let strongSelf = self {
|
||||
@ -5504,7 +5504,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
if peer.id == strongSelf.context.account.peerId {
|
||||
mode = .reminders
|
||||
} else {
|
||||
mode = .scheduledMessages
|
||||
mode = .scheduledMessages(sendWhenOnlineAvailable: peer.id.namespace == Namespaces.Peer.CloudUser)
|
||||
}
|
||||
let controller = ChatScheduleTimeController(context: strongSelf.context, mode: mode, minimalTime: strongSelf.presentationInterfaceState.slowmodeState?.timeout, completion: { [weak self] time in
|
||||
if let strongSelf = self {
|
||||
@ -5693,7 +5693,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
if peer.id == strongSelf.context.account.peerId {
|
||||
mode = .reminders
|
||||
} else {
|
||||
mode = .scheduledMessages
|
||||
mode = .scheduledMessages(sendWhenOnlineAvailable: peer.id.namespace == Namespaces.Peer.CloudUser)
|
||||
}
|
||||
let controller = ChatScheduleTimeController(context: strongSelf.context, mode: mode, minimalTime: strongSelf.presentationInterfaceState.slowmodeState?.timeout, completion: { [weak self] time in
|
||||
if let strongSelf = self {
|
||||
@ -5980,7 +5980,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
if peerId == self.context.account.peerId {
|
||||
mode = .reminders
|
||||
} else {
|
||||
mode = .scheduledMessages
|
||||
mode = .scheduledMessages(sendWhenOnlineAvailable: peerId.namespace == Namespaces.Peer.CloudUser)
|
||||
}
|
||||
let controller = ChatScheduleTimeController(context: self.context, mode: mode, minimalTime: self.presentationInterfaceState.slowmodeState?.timeout, dismissByTapOutside: false, completion: { [weak self] time in
|
||||
if let strongSelf = self {
|
||||
|
||||
@ -9,7 +9,7 @@ import SwiftSignalKit
|
||||
import AccountContext
|
||||
|
||||
enum ChatScheduleTimeControllerMode {
|
||||
case scheduledMessages
|
||||
case scheduledMessages(sendWhenOnlineAvailable: Bool)
|
||||
case reminders
|
||||
}
|
||||
|
||||
|
||||
@ -102,7 +102,9 @@ class ChatScheduleTimeControllerNode: ViewControllerTracingNode, UIScrollViewDel
|
||||
self.contentContainerNode.addSubnode(self.titleNode)
|
||||
self.contentContainerNode.addSubnode(self.cancelButton)
|
||||
self.contentContainerNode.addSubnode(self.doneButton)
|
||||
//self.contentContainerNode.addSubnode(self.onlineButton)
|
||||
if case .scheduledMessages(true) = self.mode {
|
||||
self.contentContainerNode.addSubnode(self.onlineButton)
|
||||
}
|
||||
|
||||
self.cancelButton.addTarget(self, action: #selector(self.cancelButtonPressed), forControlEvents: .touchUpInside)
|
||||
self.doneButton.pressed = { [weak self] in
|
||||
@ -311,7 +313,10 @@ class ChatScheduleTimeControllerNode: ViewControllerTracingNode, UIScrollViewDel
|
||||
let cleanInsets = layout.insets(options: [.statusBar])
|
||||
insets.top = max(10.0, insets.top)
|
||||
|
||||
var buttonOffset: CGFloat = 0.0 //44.0
|
||||
var buttonOffset: CGFloat = 0.0
|
||||
if case .scheduledMessages(true) = self.mode {
|
||||
buttonOffset += 44.0
|
||||
}
|
||||
|
||||
let bottomInset: CGFloat = 10.0 + cleanInsets.bottom
|
||||
let titleHeight: CGFloat = 54.0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user