From d5188d73f92e51e280accc427d27b31b0a165d5e Mon Sep 17 00:00:00 2001 From: luvletter2333 Date: Mon, 20 Sep 2021 22:56:28 +0800 Subject: [PATCH] Fix open from homescreen shortcut --- .../org/telegram/messenger/OpenChatReceiver.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/OpenChatReceiver.java b/TMessagesProj/src/main/java/org/telegram/messenger/OpenChatReceiver.java index a85575515..127f9b64d 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/OpenChatReceiver.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/OpenChatReceiver.java @@ -29,8 +29,16 @@ public class OpenChatReceiver extends Activity { return; } try { - long chatId = intent.getLongExtra("chatId", 0); - long userId = intent.getLongExtra("userId", 0); + long chatId; + long userId; + try { + chatId = intent.getLongExtra("chatId", 0); + userId = intent.getLongExtra("userId", 0); + } catch (ClassCastException castException){ + chatId = intent.getIntExtra("chatId", 0); + userId = intent.getIntExtra("userId", 0); + // A temporary fix for 8.0.1 update, should be reverted when official fix this + } int encId = intent.getIntExtra("encId", 0); if (chatId == 0 && userId == 0 && encId == 0) { return;