Skip to content

Commit

Permalink
[WIP] Stage vCard (#2186)
Browse files Browse the repository at this point in the history
I guess I have to inject a ContactCardView somewhere... or make the FileView more powerful
  • Loading branch information
zeitschlag committed Jun 14, 2024
1 parent 8fdde45 commit 44fa5b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions deltachat-ios/Chat/ChatViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1658,13 +1658,11 @@ class ChatViewController: UITableViewController, UITableViewDropDelegate {

private func stageVCard(url: URL) {
keepKeyboard = true
DispatchQueue.main.async { [weak self] in
guard let self else { return }
self.draft.setAttachment(viewType: DC_MSG_VCARD, path: url.relativePath)
self.configureDraftArea(draft: self.draft)
self.focusInputTextView()
FileHelper.deleteFile(atPath: url.relativePath)
}

draft.setAttachment(viewType: DC_MSG_VCARD, path: url.relativePath)
configureDraftArea(draft: draft)
focusInputTextView()
FileHelper.deleteFile(atPath: url.relativePath)
}

private func stageDocument(url: NSURL) {
Expand Down
2 changes: 1 addition & 1 deletion deltachat-ios/Chat/Views/DocumentPreview.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class DocumentPreview: DraftPreview {
override public func configure(draft: DraftModel) {
if !draft.isEditing,
let viewType = draft.viewType,
viewType == DC_MSG_FILE || viewType == DC_MSG_WEBXDC,
[DC_MSG_WEBXDC, DC_MSG_FILE, DC_MSG_VCARD].contains(viewType),
let path = draft.attachment {
var tmpMsg: DcMsg
if let draftMsg = draft.draftMsg {
Expand Down

0 comments on commit 44fa5b6

Please sign in to comment.