Skip to content

Commit

Permalink
Remove existing app-selector (#2450)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitschlag committed Jan 16, 2025
1 parent 320bdfd commit 006f47a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 291 deletions.
4 changes: 0 additions & 4 deletions deltachat-ios.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
30152CA025A5D97900377714 /* UIEdgeInsets+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 305961832346125000C80F33 /* UIEdgeInsets+Extensions.swift */; };
3015634423A003BA00E9DEF4 /* AudioRecorderController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3015634323A003BA00E9DEF4 /* AudioRecorderController.swift */; };
3022E6BE22E8768800763272 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3022E6C022E8768800763272 /* InfoPlist.strings */; };
30238CFB28A501C300EF14AC /* WebxdcSelector.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30238CFA28A501C300EF14AC /* WebxdcSelector.swift */; };
30238CFD28A5028300EF14AC /* WebxdcGridCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30238CFC28A5028300EF14AC /* WebxdcGridCell.swift */; };
30238CFF28A5554C00EF14AC /* FileHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30238CFE28A5554C00EF14AC /* FileHelper.swift */; };
30238D0028A557E800EF14AC /* FileHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30238CFE28A5554C00EF14AC /* FileHelper.swift */; };
Expand Down Expand Up @@ -327,7 +326,6 @@
3022E6D022E8769D00763272 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/InfoPlist.strings; sourceTree = "<group>"; };
3022E6D122E8769E00763272 /* lt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = lt; path = lt.lproj/InfoPlist.strings; sourceTree = "<group>"; };
3022E6D322E876A100763272 /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/InfoPlist.strings; sourceTree = "<group>"; };
30238CFA28A501C300EF14AC /* WebxdcSelector.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebxdcSelector.swift; sourceTree = "<group>"; };
30238CFC28A5028300EF14AC /* WebxdcGridCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebxdcGridCell.swift; sourceTree = "<group>"; };
30238CFE28A5554C00EF14AC /* FileHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileHelper.swift; sourceTree = "<group>"; };
302589FE2452FA280086C1CD /* ShareAttachment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareAttachment.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1074,7 +1072,6 @@
30149D9222F21129003C12B5 /* QrViewController.swift */,
30B0ACF924AB5B99004D5E29 /* EphemeralMessagesViewController.swift */,
AE8F503424753DFE007FEE0B /* GalleryViewController.swift */,
30238CFA28A501C300EF14AC /* WebxdcSelector.swift */,
AED423D2249F578B00B6B2BB /* AddGroupMembersViewController.swift */,
AE39D322249CFC1A007346A1 /* FilesViewController.swift */,
AE57C083255310BB003CFE70 /* ContextMenuController.swift */,
Expand Down Expand Up @@ -1645,7 +1642,6 @@
3080A027277DE12D00E74565 /* InputBarButtonItem.swift in Sources */,
D85DF9782C4A96CB00A01408 /* UserDefaults+Extensions.swift in Sources */,
D8C19DD02C1C9FFE00B32F6D /* ContactCardPreview.swift in Sources */,
30238CFB28A501C300EF14AC /* WebxdcSelector.swift in Sources */,
AE57C084255310BB003CFE70 /* ContextMenuController.swift in Sources */,
304219D92440734A00516852 /* DcMsg+Extension.swift in Sources */,
AE52EA19229EB53C00C586C9 /* ContactDetailHeader.swift in Sources */,
Expand Down
50 changes: 0 additions & 50 deletions deltachat-ios/Chat/ChatViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1218,12 +1218,6 @@ class ChatViewController: UITableViewController, UITableViewDropDelegate {
alert.addAction(galleryAction)
alert.addAction(appPickerAction)
alert.addAction(documentAction)

if dcContext.hasWebxdc() {
let webxdcAction = UIAlertAction(title: String.localized("webxdc_apps"), style: .default, handler: webxdcButtonPressed(_:))
alert.addAction(webxdcAction)
}

alert.addAction(voiceMessageAction)

if let config = dcContext.getConfig("webrtc_instance"), !config.isEmpty {
Expand Down Expand Up @@ -1384,20 +1378,6 @@ class ChatViewController: UITableViewController, UITableViewDropDelegate {
}
}

private func showWebxdcSelector() {
let webxdcSelector = WebxdcSelector(context: dcContext)
webxdcSelector.delegate = self
let webxdcSelectorNavigationController = UINavigationController(rootViewController: webxdcSelector)
if #available(iOS 15.0, *) {
if let sheet = webxdcSelectorNavigationController.sheetPresentationController {
sheet.detents = [.medium()]
sheet.preferredCornerRadius = 20
}
}

self.present(webxdcSelectorNavigationController, animated: true)
}

private func showDocumentLibrary() {
mediaPicker?.showDocumentLibrary()
}
Expand Down Expand Up @@ -1478,10 +1458,6 @@ class ChatViewController: UITableViewController, UITableViewDropDelegate {
navigationController?.present(alert, animated: true, completion: nil)
}

private func webxdcButtonPressed(_ action: UIAlertAction) {
showWebxdcSelector()
}

private func documentActionPressed(_ action: UIAlertAction) {
showDocumentLibrary()
}
Expand Down Expand Up @@ -2598,32 +2574,6 @@ extension ChatViewController: ChatInputTextViewPasteDelegate {
}
}


extension ChatViewController: WebxdcSelectorDelegate {
func onWebxdcFromFilesSelected(url: NSURL) {
DispatchQueue.main.async { [weak self] in
guard let self else { return }
self.becomeFirstResponder()
self.onDocumentSelected(url: url)
}
}

func onWebxdcSelected(msgId: Int) {
DispatchQueue.main.async { [weak self] in
guard let self else { return }
let message = self.dcContext.getMessage(id: msgId)
if let filename = message.fileURL {
let nsdata = NSData(contentsOf: filename)
guard let data = nsdata as? Data else { return }
let url = FileHelper.saveData(data: data, suffix: "xdc", directory: .cachesDirectory)
self.draft.setAttachment(viewType: DC_MSG_WEBXDC, path: url)
self.configureDraftArea(draft: self.draft)
self.focusInputTextView()
}
}
}
}

// MARK: - ChatDropInteractionDelegate
extension ChatViewController: ChatDropInteractionDelegate {
func onImageDragAndDropped(image: UIImage) {
Expand Down
237 changes: 0 additions & 237 deletions deltachat-ios/Controller/WebxdcSelector.swift

This file was deleted.

0 comments on commit 006f47a

Please sign in to comment.