mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Merge commit '7d8920db82052bce3d9c6f37b2bd78edebd6f06e'
# Conflicts: # submodules/CallListUI/Sources/CallListController.swift
This commit is contained in:
@@ -207,6 +207,9 @@ public final class CallListController: TelegramBaseController {
|
||||
}
|
||||
|
||||
private func createGroupCall() {
|
||||
guard !self.presentAccountFrozenInfoIfNeeded() else {
|
||||
return
|
||||
}
|
||||
let _ = (self.context.engine.calls.createConferenceCall()
|
||||
|> deliverOnMainQueue).startStandalone(next: { [weak self] call in
|
||||
guard let self else {
|
||||
@@ -262,8 +265,11 @@ public final class CallListController: TelegramBaseController {
|
||||
strongSelf.call(peerId, isVideo: isVideo)
|
||||
}
|
||||
}, joinGroupCall: { [weak self] peerId, activeCall in
|
||||
if let strongSelf = self {
|
||||
strongSelf.joinGroupCall(peerId: peerId, invite: nil, activeCall: activeCall)
|
||||
if let self {
|
||||
guard !self.presentAccountFrozenInfoIfNeeded() else {
|
||||
return
|
||||
}
|
||||
self.joinGroupCall(peerId: peerId, invite: nil, activeCall: activeCall)
|
||||
}
|
||||
}, openInfo: { [weak self] peerId, messages in
|
||||
if let strongSelf = self {
|
||||
@@ -439,6 +445,9 @@ public final class CallListController: TelegramBaseController {
|
||||
}
|
||||
|
||||
private func beginCallImpl() {
|
||||
guard !self.presentAccountFrozenInfoIfNeeded() else {
|
||||
return
|
||||
}
|
||||
let controller = self.context.sharedContext.makeContactSelectionController(ContactSelectionControllerParams(context: self.context, title: { $0.Calls_NewCall }, displayCallIcons: true))
|
||||
controller.navigationPresentation = .modal
|
||||
self.createActionDisposable.set((controller.result
|
||||
@@ -469,6 +478,23 @@ public final class CallListController: TelegramBaseController {
|
||||
}
|
||||
}
|
||||
|
||||
private func presentAccountFrozenInfoIfNeeded(delay: Bool = false) -> Bool {
|
||||
if self.context.isFrozen {
|
||||
let present = {
|
||||
self.push(self.context.sharedContext.makeAccountFreezeInfoScreen(context: self.context))
|
||||
}
|
||||
if delay {
|
||||
Queue.mainQueue().after(0.3) {
|
||||
present()
|
||||
}
|
||||
} else {
|
||||
present()
|
||||
}
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
@objc func editPressed() {
|
||||
self.editingMode = true
|
||||
|
||||
@@ -522,6 +548,9 @@ public final class CallListController: TelegramBaseController {
|
||||
}
|
||||
|
||||
private func call(_ peerId: EnginePeer.Id, isVideo: Bool, began: (() -> Void)? = nil) {
|
||||
guard !self.presentAccountFrozenInfoIfNeeded() else {
|
||||
return
|
||||
}
|
||||
self.peerViewDisposable.set((self.context.account.viewTracker.peerView(peerId)
|
||||
|> take(1)
|
||||
|> deliverOnMainQueue).startStrict(next: { [weak self] view in
|
||||
|
||||
Reference in New Issue
Block a user