Skip to content

Commit

Permalink
Reduce indention (#2285)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitschlag committed Sep 9, 2024
1 parent 25ee730 commit 5ae171f
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions deltachat-ios/Chat/ChatViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1723,18 +1723,17 @@ class ChatViewController: UITableViewController, UITableViewDropDelegate {

private func sendSticker(_ image: UIImage) {
DispatchQueue.global().async { [weak self] in
guard let self else { return }
if let path = ImageFormat.saveImage(image: image, directory: .cachesDirectory) {
if self.draft.draftMsg != nil {
draft.setAttachment(viewType: DC_MSG_STICKER, path: path)
}
self.sendAttachmentMessage(viewType: DC_MSG_STICKER, filePath: path, message: nil, quoteMessage: self.draft.quoteMessage)
guard let self, let path = ImageFormat.saveImage(image: image, directory: .cachesDirectory) else { return }

if self.draft.draftMsg != nil {
self.draft.setAttachment(viewType: DC_MSG_STICKER, path: path)
}
self.sendAttachmentMessage(viewType: DC_MSG_STICKER, filePath: path, message: nil, quoteMessage: self.draft.quoteMessage)

FileHelper.deleteFile(atPath: path)
self.draft.clear()
DispatchQueue.main.async {
self.draftArea.quotePreview.cancel()
}
FileHelper.deleteFile(atPath: path)
self.draft.clear()
DispatchQueue.main.async {
self.draftArea.quotePreview.cancel()
}
}
}
Expand Down

0 comments on commit 5ae171f

Please sign in to comment.