From 7663d4cee2dffec1fcbe81f77aae5add8525ad72 Mon Sep 17 00:00:00 2001 From: gdlbo <41114720+gdlbo@users.noreply.github.com> Date: Tue, 5 Jul 2022 15:11:24 +0300 Subject: [PATCH] Update JsonInjectors.java --- .../java/ru/vtosters/lite/utils/JsonInjectors.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/ru/vtosters/lite/utils/JsonInjectors.java b/app/src/main/java/ru/vtosters/lite/utils/JsonInjectors.java index 31c7d4abc..db56576ab 100644 --- a/app/src/main/java/ru/vtosters/lite/utils/JsonInjectors.java +++ b/app/src/main/java/ru/vtosters/lite/utils/JsonInjectors.java @@ -35,7 +35,7 @@ public class JsonInjectors{ } public static JSONObject convBar(JSONObject orig) throws JSONException{ - if(!dev()) return orig; + if(!dev()) return orig.optJSONObject("conversation_bar"); var peerid = Objects.requireNonNull(orig.optJSONObject("peer")).optInt("id"); var pic = "https://image.pngaaa.com/641/326641-middle.png"; // can be null @@ -43,15 +43,15 @@ public class JsonInjectors{ var link = "https://vtosters.app"; // can be null var linktitle = "Test button"; // can be null - var hasIcon = true; // !pic.isEmpty(); - var hasButton = true; // !buttons.isEmpty(); - var isPicture = pic.endsWith(".png") || pic.endsWith(".jpg") || pic.endsWith(".jpeg") || pic.endsWith(".webp"); - // "{\"layout\":\"tertiary\",\"text\":\"" + linktitle + "\",\"type\":\"link\",\"link\":\"" + link + "\"}"; var buttons = decode("eyJsYXlvdXQiOiJ0ZXJ0aWFyeSIsInRleHQiOiI=") + linktitle + decode("IiwidHlwZSI6ImxpbmsiLCJsaW5rIjoi") + link + decode("In0="); // ,"icon":" + pic + " var icon = decode("LCJpY29uIjoi") + pic + decode("Ig=="); + var hasIcon = !pic.isEmpty(); + var hasButton = !buttons.isEmpty(); + var isPicture = pic.endsWith(".png") || pic.endsWith(".jpg") || pic.endsWith(".jpeg") || pic.endsWith(".webp"); + if(!isPicture) hasIcon = false; if(!hasIcon) icon = ""; if(!hasButton) buttons = "";