Fix open from homescreen shortcut

This commit is contained in:
luvletter2333 2021-09-21 01:05:53 +08:00
parent 87a6a5b5e9
commit 7cc94fa9ea
No known key found for this signature in database
GPG Key ID: BFD68B892BECC1D8

View File

@ -29,16 +29,12 @@ public class OpenChatReceiver extends Activity {
return;
}
try {
long chatId;
long userId;
try {
chatId = intent.getLongExtra("chatId", 0);
userId = intent.getLongExtra("userId", 0);
} catch (ClassCastException castException){
long chatId = intent.getLongExtra("chatId", 0);
long userId = intent.getLongExtra("userId", 0);
if (chatId == 0)
chatId = intent.getIntExtra("chatId", 0);
if (userId == 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;