mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-02 00:17:02 +00:00
Add alert
This commit is contained in:
parent
131d80a1d9
commit
01b221da51
@ -5977,3 +5977,11 @@ Sorry for the inconvenience.";
|
|||||||
"ChannelInfo.CreateVoiceChat" = "Create Voice Chat";
|
"ChannelInfo.CreateVoiceChat" = "Create Voice Chat";
|
||||||
|
|
||||||
"VoiceChat.AnonymousDisabledAlertText" = "Sorry, you can't join voice chat as an anonymous admin.";
|
"VoiceChat.AnonymousDisabledAlertText" = "Sorry, you can't join voice chat as an anonymous admin.";
|
||||||
|
|
||||||
|
"VoiceChat.EndConfirmationTitle" = "End voice chat";
|
||||||
|
"VoiceChat.EndConfirmationText" = "Are you sure you want to end this voice chat?";
|
||||||
|
"VoiceChat.EndConfirmationEnd" = "End";
|
||||||
|
|
||||||
|
"CHAT_VOICECHAT_START" = "%1$@ has started voice chat in the group %2$@";
|
||||||
|
"CHAT_VOICECHAT_INVITE" = "%1$@ has invited %3$@ in the group %2$@";
|
||||||
|
"CHAT_VOICECHAT_INVITE_YOU" = "%1$@ has invited you to voice chat in the group %1$@";
|
||||||
|
@ -35,6 +35,7 @@ swift_library(
|
|||||||
"//submodules/UndoUI:UndoUI",
|
"//submodules/UndoUI:UndoUI",
|
||||||
"//submodules/AudioBlob:AudioBlob",
|
"//submodules/AudioBlob:AudioBlob",
|
||||||
"//submodules/AnimatedAvatarSetNode:AnimatedAvatarSetNode",
|
"//submodules/AnimatedAvatarSetNode:AnimatedAvatarSetNode",
|
||||||
|
"//submodules/AlertUI:AlertUI",
|
||||||
],
|
],
|
||||||
visibility = [
|
visibility = [
|
||||||
"//visibility:public",
|
"//visibility:public",
|
||||||
|
@ -18,6 +18,8 @@ import ContextUI
|
|||||||
import ShareController
|
import ShareController
|
||||||
import DeleteChatPeerActionSheetItem
|
import DeleteChatPeerActionSheetItem
|
||||||
import UndoUI
|
import UndoUI
|
||||||
|
import AlertUI
|
||||||
|
import PresentationDataUtils
|
||||||
|
|
||||||
private final class VoiceChatControllerTitleView: UIView {
|
private final class VoiceChatControllerTitleView: UIView {
|
||||||
private var theme: PresentationTheme
|
private var theme: PresentationTheme
|
||||||
@ -690,12 +692,24 @@ public final class VoiceChatController: ViewController {
|
|||||||
guard let strongSelf = self else {
|
guard let strongSelf = self else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let _ = (strongSelf.call.leave(terminateIfPossible: true)
|
|
||||||
|> filter { $0 }
|
let action: () -> Void = {
|
||||||
|> take(1)
|
guard let strongSelf = self else {
|
||||||
|> deliverOnMainQueue).start(completed: {
|
return
|
||||||
self?.controller?.dismiss()
|
}
|
||||||
})
|
|
||||||
|
let _ = (strongSelf.call.leave(terminateIfPossible: true)
|
||||||
|
|> filter { $0 }
|
||||||
|
|> take(1)
|
||||||
|
|> deliverOnMainQueue).start(completed: {
|
||||||
|
self?.controller?.dismiss()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
let alert = textAlertController(context: strongSelf.context, title: strongSelf.presentationData.strings.VoiceChat_EndConfirmationTitle, text: strongSelf.presentationData.strings.VoiceChat_EndConfirmationText, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_Cancel, action: {}), TextAlertAction(type: .genericAction, title: strongSelf.presentationData.strings.VoiceChat_EndConfirmationEnd, action: {
|
||||||
|
action()
|
||||||
|
})])
|
||||||
|
strongSelf.controller?.present(alert, in: .window(.root))
|
||||||
})))
|
})))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user