2016-05-25 23:49:47 +02:00
|
|
|
/*
|
2019-01-23 18:03:33 +01:00
|
|
|
* This is the source code of Telegram for Android v. 5.x.x.
|
2016-05-25 23:49:47 +02:00
|
|
|
* It is licensed under GNU GPL v. 2 or later.
|
|
|
|
* You should have received a copy of the license in this archive (see LICENSE).
|
|
|
|
*
|
2019-01-23 18:03:33 +01:00
|
|
|
* Copyright Nikolai Kudashov, 2013-2018.
|
2016-05-25 23:49:47 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
package org.telegram.messenger;
|
|
|
|
|
|
|
|
import android.app.Activity;
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.os.Bundle;
|
|
|
|
|
|
|
|
import org.telegram.ui.LaunchActivity;
|
|
|
|
|
|
|
|
public class OpenChatReceiver extends Activity {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
Intent intent = getIntent();
|
|
|
|
if (intent == null) {
|
|
|
|
finish();
|
2021-09-20 00:10:42 +02:00
|
|
|
return;
|
2016-05-25 23:49:47 +02:00
|
|
|
}
|
|
|
|
if (intent.getAction() == null || !intent.getAction().startsWith("com.tmessages.openchat")) {
|
|
|
|
finish();
|
|
|
|
return;
|
|
|
|
}
|
2019-01-23 18:03:33 +01:00
|
|
|
try {
|
2021-09-21 11:51:08 +02:00
|
|
|
long chatId = intent.getLongExtra("chatId", intent.getIntExtra("chatId", 0));
|
|
|
|
long userId = intent.getLongExtra("userId", intent.getIntExtra("userId", 0));
|
2019-01-23 18:03:33 +01:00
|
|
|
int encId = intent.getIntExtra("encId", 0);
|
|
|
|
if (chatId == 0 && userId == 0 && encId == 0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
} catch (Throwable e) {
|
2021-09-21 11:51:08 +02:00
|
|
|
FileLog.e(e);
|
2019-01-23 18:03:33 +01:00
|
|
|
return;
|
|
|
|
}
|
2016-05-25 23:49:47 +02:00
|
|
|
Intent intent2 = new Intent(this, LaunchActivity.class);
|
|
|
|
intent2.setAction(intent.getAction());
|
|
|
|
intent2.putExtras(intent);
|
|
|
|
startActivity(intent2);
|
|
|
|
finish();
|
2019-01-23 18:03:33 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
*/
|
2016-05-25 23:49:47 +02:00
|
|
|
}
|
|
|
|
}
|