fix: create images in a tmp dir

This commit is contained in:
Richard Ramos 2020-07-21 11:31:58 -04:00 committed by Iuri Matias
parent 7115a1bed6
commit 6829a24986
5 changed files with 6 additions and 4 deletions

View File

@ -1,6 +1,7 @@
import NimQml, Tables, json, sequtils, chronicles, times, re, sugar, strutils, os
import ../../status/status
import ../../status/libstatus/accounts/constants
import ../../status/accounts as status_accounts
import ../../status/chat as status_chat
import ../../status/messages as status_messages
@ -110,7 +111,7 @@ QtObject:
proc sendImage*(self: ChatsView, imagePath: string) {.slot.} =
let image = replace(imagePath, "file://", "")
let tmpImagePath = image_resizer(image, 2000)
let tmpImagePath = image_resizer(image, 2000, TMPDIR)
self.status.chat.sendImage(self.activeChannel.id, tmpImagePath)
removeFile(tmpImagePath)

View File

@ -131,7 +131,7 @@ QtObject:
ChatMessageRoles.ResponseTo.int: "responseTo",
ChatMessageRoles.Index.int: "index",
ChatMessageRoles.ImageUrls.int: "imageUrls",
ChatMessageRoles.Timeout.int: "timeout"
ChatMessageRoles.Timeout.int: "timeout",
ChatMessageRoles.Image.int: "image"
}.toTable

View File

@ -213,3 +213,4 @@ let clientDir =
let DATADIR* = joinPath(clientDir, "data") & sep
let KEYSTOREDIR* = joinPath(clientDir, "data", "keystore") & sep
let TMPDIR* = joinPath(clientDir, "tmp") & sep

2
vendor/DOtherSide vendored

@ -1 +1 @@
Subproject commit bdd329257355588146087f77ecdc2b3f7ed3857c
Subproject commit e3baf29683f713ec418d3bb5c39fa043bd87f92f

2
vendor/nimqml vendored

@ -1 +1 @@
Subproject commit 5befb459437ea33e3e8c5bc7ac2ebc15c65a483e
Subproject commit 2f26af684a6e40e49e5577a4606ad64ab0ffa8dc