fix(community-service): fix community image parsing for windows

Fixes #9678
This commit is contained in:
Jonathan Rainville 2023-03-01 16:39:41 -05:00
parent ef99e3d017
commit 7db4a5ca52
1 changed files with 8 additions and 5 deletions

View File

@ -883,7 +883,8 @@ QtObject:
bannerJsonStr: string,
encrypted: bool) =
try:
var image = singletonInstance.utils.formatImagePath(imageUrl)
var bannerJson = bannerJsonStr.parseJson
bannerJson{"imagePath"} = newJString(singletonInstance.utils.formatImagePath(bannerJson["imagePath"].getStr))
var tagsString = tags
if len(tagsString) == 0:
tagsString = "[]"
@ -896,11 +897,11 @@ QtObject:
access,
color,
tagsString,
image,
singletonInstance.utils.formatImagePath(imageUrl),
aX, aY, bX, bY,
historyArchiveSupportEnabled,
pinMessageAllMembersEnabled,
bannerJsonStr,
$bannerJson,
encrypted)
if response.error != nil:
@ -943,6 +944,8 @@ QtObject:
let logoJson = parseJson(logoJsonStr)
let cropRectJson = logoJson["cropRect"]
var tagsString = tags
var bannerJson = bannerJsonStr.parseJson
bannerJson{"imagePath"} = newJString(singletonInstance.utils.formatImagePath(bannerJson["imagePath"].getStr))
if len(tagsString) == 0:
tagsString = "[]"
let response = status_go.editCommunity(
@ -954,12 +957,12 @@ QtObject:
access,
color,
tagsString,
logoJson["imagePath"].getStr(),
singletonInstance.utils.formatImagePath(logoJson["imagePath"].getStr()),
int(cropRectJson["x"].getFloat()),
int(cropRectJson["y"].getFloat()),
int(cropRectJson["x"].getFloat() + cropRectJson["width"].getFloat()),
int(cropRectJson["y"].getFloat() + cropRectJson["height"].getFloat()),
bannerJsonStr,
$bannerJson,
historyArchiveSupportEnabled,
pinMessageAllMembersEnabled)