diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-05-21 20:55:52 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-05-21 20:55:52 +0200 |
commit | ac3926cfbf29c6e1ca62a66f318efad666d17a19 (patch) | |
tree | b4c5cef73f57974e29186304d2c60beceb6475eb /src/standardPush | |
parent | 3a66fef2030be00615e47a725cdf375e96ad3093 (diff) |
make fcm receiver ignore messages when all accounts are disabled
Diffstat (limited to 'src/standardPush')
-rw-r--r-- | src/standardPush/java/de/pixart/messenger/services/PushMessageReceiver.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/standardPush/java/de/pixart/messenger/services/PushMessageReceiver.java b/src/standardPush/java/de/pixart/messenger/services/PushMessageReceiver.java index ffbb93425..d45ded454 100644 --- a/src/standardPush/java/de/pixart/messenger/services/PushMessageReceiver.java +++ b/src/standardPush/java/de/pixart/messenger/services/PushMessageReceiver.java @@ -1,13 +1,20 @@ package de.pixart.messenger.services; import android.content.Intent; +import android.util.Log; import java.util.Map; +import de.pixart.messenger.Config; + public class PushMessageReceiver extends FirebaseMessagingService { @Override public void onMessageReceived(RemoteMessage message) { + if (!EventReceiver.hasEnabledAccounts(this)) { + Log.d(Config.LOGTAG, "PushMessageReceiver ignored message because no accounts are enabled"); + return; + } Map<String, String> data = message.getData(); Intent intent = new Intent(this, XmppConnectionService.class); intent.setAction(XmppConnectionService.ACTION_FCM_MESSAGE_RECEIVED); |