From 738057587d932af59df99b4a6a5392182d43dc13 Mon Sep 17 00:00:00 2001 From: Ryan Tharp Date: Thu, 5 Mar 2020 21:53:12 -0800 Subject: [PATCH] open group avatar redo conversion properly --- js/background.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/js/background.js b/js/background.js index eef39319d..1ca333868 100644 --- a/js/background.js +++ b/js/background.js @@ -754,12 +754,10 @@ } // lets not allow ANY URLs, lets force it to be local to public chat server - const relativeFileUrl = fileObj.url.replace( - API.serverAPI.baseServerUrl, - '' - ); + const url = new URL(fileObj.url); + // write it to the channel - await API.setChannelAvatar(relativeFileUrl); + await API.setChannelAvatar(url.pathname); } if (await API.setChannelName(groupName)) { @@ -2029,7 +2027,7 @@ } const isDuplicate = await isMessageDuplicate(message); if (isDuplicate) { - // RSS expects duplciates, so squelch log + // RSS expects duplicates, so squelch log if (!descriptorId.match(/^rss:/)) { window.log.warn('Received duplicate message', message.idForLogging()); }