aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/free/java/eu/siacs/conversations/services/PushManagementService.java2
-rw-r--r--src/main/java/eu/siacs/conversations/services/XmppConnectionService.java4
-rw-r--r--src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java2
-rw-r--r--src/playstore/java/eu/siacs/conversations/services/PushManagementService.java11
-rw-r--r--src/playstore/res/values/gcm.xml5
5 files changed, 15 insertions, 9 deletions
diff --git a/src/free/java/eu/siacs/conversations/services/PushManagementService.java b/src/free/java/eu/siacs/conversations/services/PushManagementService.java
index 48c576cec..ff97a5fb9 100644
--- a/src/free/java/eu/siacs/conversations/services/PushManagementService.java
+++ b/src/free/java/eu/siacs/conversations/services/PushManagementService.java
@@ -14,7 +14,7 @@ public class PushManagementService {
//stub implementation. only affects playstore flavor
}
- public boolean available() {
+ public boolean available(Account account) {
return false;
}
}
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
index 69a59aa04..3ca235ef5 100644
--- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
@@ -259,7 +259,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
fetchRosterFromServer(account);
fetchBookmarks(account);
sendPresence(account);
- if (mPushManagementService.pushAvailable(account)) {
+ if (mPushManagementService.available(account)) {
mPushManagementService.registerPushTokenOnServer(account);
}
mMessageArchiveService.executePendingQueries(account);
@@ -2856,7 +2856,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
private void refreshAllGcmTokens() {
for(Account account : getAccounts()) {
- if (account.isOnlineAndConnected() && mPushManagementService.pushAvailable(account)) {
+ if (account.isOnlineAndConnected() && mPushManagementService.available(account)) {
mPushManagementService.registerPushTokenOnServer(account);
}
}
diff --git a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
index cfa1889a0..9b6e40763 100644
--- a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
@@ -686,7 +686,7 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
this.mServerInfoHttpUpload.setText(R.string.server_info_unavailable);
}
- this.mPushRow.setVisibility(xmppConnectionService.getPushManagementService().available() ? View.VISIBLE : View.GONE);
+ this.mPushRow.setVisibility(xmppConnectionService.getPushManagementService().available(mAccount) ? View.VISIBLE : View.GONE);
if (features.push()) {
this.mServerInfoPush.setText(R.string.server_info_available);
diff --git a/src/playstore/java/eu/siacs/conversations/services/PushManagementService.java b/src/playstore/java/eu/siacs/conversations/services/PushManagementService.java
index d65170eec..68e824cbb 100644
--- a/src/playstore/java/eu/siacs/conversations/services/PushManagementService.java
+++ b/src/playstore/java/eu/siacs/conversations/services/PushManagementService.java
@@ -20,7 +20,7 @@ import eu.siacs.conversations.xmpp.stanzas.IqPacket;
public class PushManagementService {
- private static final String APP_SERVER = "push.conversations.im";
+ private static final String APP_SERVER = "push.siacs.eu";
protected final XmppConnectionService mXmppConnectionService;
@@ -64,12 +64,13 @@ public class PushManagementService {
}
- public boolean available() {
- return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(mXmppConnectionService) == ConnectionResult.SUCCESS;
+
+ public boolean available(Account account) {
+ return account.getXmppConnection().getFeatures().push() && playServicesAvailable();
}
- public boolean pushAvailable(Account account) {
- return account.getXmppConnection().getFeatures().push() && available();
+ private boolean playServicesAvailable() {
+ return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(mXmppConnectionService) == ConnectionResult.SUCCESS;
}
interface OnGcmInstanceTokenRetrieved {
diff --git a/src/playstore/res/values/gcm.xml b/src/playstore/res/values/gcm.xml
new file mode 100644
index 000000000..ee780d776
--- /dev/null
+++ b/src/playstore/res/values/gcm.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="gcm_defaultSenderId" translatable="false">159709679736</string>
+ <string name="google_app_id">1:159709679736:android:a61b47ae910a1ad7</string>
+</resources>