Return voice chat recording title setup

This commit is contained in:
Ilya Laktyushin 2021-09-13 22:42:34 +03:00
parent e3206fc855
commit b29e2aa5c6
2 changed files with 42 additions and 29 deletions

View File

@ -5837,8 +5837,11 @@ Sorry for the inconvenience.";
"VoiceChat.StartRecordingText" = "Do you want to start recording this chat and save the result into an audio file?\n\nOther members will see that the chat is being recorded.";
"LiveStream.StartRecordingText" = "Do you want to start recording this live stream and save the result into an audio file?\n\nOther members will see that the chat is being recorded.";
"VoiceChat.StartRecordingStart" = "Start";
"VoiceChat.StartRecordingTextVideo" = "Do you want to start recording this chat and save the result into a video file?\n\nOther members will see that the chat is being recorded.";
"LiveStream.StartRecordingTextVideo" = "Do you want to start recording this live stream and save the result into a video file?\n\nOther members will see that the chat is being recorded.";
"VoiceChat.RecordingTitlePlaceholder" = "Audio Title (Optional)";
"VoiceChat.RecordingTitlePlaceholderVideo" = "Video Title (Optional)";
"VoiceChat.RecordingStarted" = "Voice chat recording started";
"LiveStream.RecordingStarted" = "Live stream recording started";
"VoiceChat.RecordingInProgress" = "Voice chat is being recorded";

View File

@ -2657,38 +2657,48 @@ public final class VoiceChatController: ViewController {
let controller = VoiceChatRecordingSetupController(context: strongSelf.context, completion: { [weak self] videoOrientation in
if let strongSelf = self {
strongSelf.call.setShouldBeRecording(true, title: "", videoOrientation: videoOrientation)
let title: String
let text: String
let placeholder: String
if let _ = videoOrientation {
placeholder = strongSelf.presentationData.strings.VoiceChat_RecordingTitlePlaceholderVideo
} else {
placeholder = strongSelf.presentationData.strings.VoiceChat_RecordingTitlePlaceholder
}
if let channel = strongSelf.peer as? TelegramChannel, case .broadcast = channel.info {
title = strongSelf.presentationData.strings.LiveStream_StartRecordingTitle
if let _ = videoOrientation {
text = strongSelf.presentationData.strings.LiveStream_StartRecordingTextVideo
} else {
text = strongSelf.presentationData.strings.LiveStream_StartRecordingText
}
} else {
title = strongSelf.presentationData.strings.VoiceChat_StartRecordingTitle
if let _ = videoOrientation {
text = strongSelf.presentationData.strings.VoiceChat_StartRecordingTextVideo
} else {
text = strongSelf.presentationData.strings.VoiceChat_StartRecordingText
}
}
let controller = voiceChatTitleEditController(sharedContext: strongSelf.context.sharedContext, account: strongSelf.context.account, forceTheme: strongSelf.darkTheme, title: title, text: text, placeholder: placeholder, value: nil, maxLength: 40, apply: { title in
if let strongSelf = self, let title = title {
strongSelf.call.setShouldBeRecording(true, title: title, videoOrientation: videoOrientation)
let text: String
if let channel = strongSelf.peer as? TelegramChannel, case .broadcast = channel.info {
text = strongSelf.presentationData.strings.LiveStream_RecordingStarted
} else {
text = strongSelf.presentationData.strings.VoiceChat_RecordingStarted
}
strongSelf.presentUndoOverlay(content: .voiceChatRecording(text: text), action: { _ in return false })
strongSelf.call.playTone(.recordingStarted)
}
})
// let title: String
// let text: String
// if let channel = strongSelf.peer as? TelegramChannel, case .broadcast = channel.info {
// title = strongSelf.presentationData.strings.LiveStream_StartRecordingTitle
// text = strongSelf.presentationData.strings.LiveStream_StartRecordingText
// } else {
// title = strongSelf.presentationData.strings.VoiceChat_StartRecordingTitle
// text = strongSelf.presentationData.strings.VoiceChat_StartRecordingText
// }
//
// let controller = voiceChatTitleEditController(sharedContext: strongSelf.context.sharedContext, account: strongSelf.context.account, forceTheme: strongSelf.darkTheme, title: title, text: text, placeholder: strongSelf.presentationData.strings.VoiceChat_RecordingTitlePlaceholder, value: nil, maxLength: 40, apply: { title in
// if let strongSelf = self, let title = title {
// strongSelf.call.setShouldBeRecording(true, title: title, videoOrientation: nil)
//
// let text: String
// if let channel = strongSelf.peer as? TelegramChannel, case .broadcast = channel.info {
// text = strongSelf.presentationData.strings.LiveStream_RecordingStarted
// } else {
// text = strongSelf.presentationData.strings.VoiceChat_RecordingStarted
// }
//
// strongSelf.presentUndoOverlay(content: .voiceChatRecording(text: text), action: { _ in return false })
// strongSelf.call.playTone(.recordingStarted)
// }
// })
strongSelf.controller?.present(controller, in: .window(.root))
}
})
self?.controller?.present(controller, in: .window(.root))
})))
}