diff --git a/Session/Conversations/ConversationVC+Interaction.swift b/Session/Conversations/ConversationVC+Interaction.swift index 6aeaa4e64..269f1a5ca 100644 --- a/Session/Conversations/ConversationVC+Interaction.swift +++ b/Session/Conversations/ConversationVC+Interaction.swift @@ -28,13 +28,38 @@ extension ConversationVC : InputViewDelegate, MessageCellDelegate, ContextMenuAc // MARK: Call @objc func startCall(_ sender: Any) { + let alertVC = UIAlertController.init(title: nil, message: nil, preferredStyle: .actionSheet) + let voiceCallAction = UIAlertAction.init(title: NSLocalizedString("voice_call", comment: ""), style: .default) { _ in + self.startVoiceCall() + } + voiceCallAction.setValue(UIImage(named: "Phone"), forKey: "image") + alertVC.addAction(voiceCallAction) + + let videoCallAction = UIAlertAction.init(title: NSLocalizedString("video_call", comment: ""), style: .default) { _ in + self.startVideoCall() + } + videoCallAction.setValue(UIImage(named: "VideoCall"), forKey: "image") + alertVC.addAction(videoCallAction) + + let cancelAction = UIAlertAction.init(title: NSLocalizedString("TXT_CANCEL_TITLE", comment: ""), style: .cancel) {_ in + self.showInputAccessoryView() + } + alertVC.addAction(cancelAction) + self.inputAccessoryView?.isHidden = true + self.inputAccessoryView?.alpha = 0 + self.presentAlert(alertVC, animated: true) + } + + private func startVoiceCall() { + + } + + private func startVideoCall() { guard let contactSessionID = (thread as? TSContactThread)?.contactSessionID() else { return } let callVC = CallVC(for: contactSessionID, mode: .offer) callVC.conversationVC = self callVC.modalPresentationStyle = .overFullScreen callVC.modalTransitionStyle = .crossDissolve - self.inputAccessoryView?.isHidden = true - self.inputAccessoryView?.alpha = 0 present(callVC, animated: true, completion: nil) } diff --git a/Session/Meta/Images.xcassets/Session/VideoCall.imageset/Contents.json b/Session/Meta/Images.xcassets/Session/VideoCall.imageset/Contents.json new file mode 100644 index 000000000..5612afc47 --- /dev/null +++ b/Session/Meta/Images.xcassets/Session/VideoCall.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "video_call.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Session/Meta/Images.xcassets/Session/VideoCall.imageset/video_call.pdf b/Session/Meta/Images.xcassets/Session/VideoCall.imageset/video_call.pdf new file mode 100644 index 000000000..86e1c39c5 Binary files /dev/null and b/Session/Meta/Images.xcassets/Session/VideoCall.imageset/video_call.pdf differ