2016-05-25 23:49:47 +02:00
|
|
|
/*
|
|
|
|
* This is the source code of Telegram for Android v. 3.x.x.
|
|
|
|
* It is licensed under GNU GPL v. 2 or later.
|
|
|
|
* You should have received a copy of the license in this archive (see LICENSE).
|
|
|
|
*
|
2017-03-31 01:58:05 +02:00
|
|
|
* Copyright Nikolai Kudashov, 2013-2017.
|
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();
|
|
|
|
}
|
|
|
|
if (intent.getAction() == null || !intent.getAction().startsWith("com.tmessages.openchat")) {
|
|
|
|
finish();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Intent intent2 = new Intent(this, LaunchActivity.class);
|
|
|
|
intent2.setAction(intent.getAction());
|
|
|
|
intent2.putExtras(intent);
|
|
|
|
startActivity(intent2);
|
|
|
|
finish();
|
|
|
|
}
|
|
|
|
}
|