From 7db4a5ca526e482a183e2c4a8481be519f8d56f5 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Wed, 1 Mar 2023 16:39:41 -0500 Subject: [PATCH] fix(community-service): fix community image parsing for windows Fixes #9678 --- src/app_service/service/community/service.nim | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/app_service/service/community/service.nim b/src/app_service/service/community/service.nim index 9a1f7ab720..05744d1ef3 100644 --- a/src/app_service/service/community/service.nim +++ b/src/app_service/service/community/service.nim @@ -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)