Allow configuring push notifications with UnifiedPush
This commit is contained in:
@@ -39,10 +39,10 @@ public class UnifiedPushNotificationReceiver extends MessagingReceiver{
|
|||||||
if (account != null) {
|
if (account != null) {
|
||||||
PublicKeySet ks = endpoint.getPubKeySet();
|
PublicKeySet ks = endpoint.getPubKeySet();
|
||||||
if (ks != null){
|
if (ks != null){
|
||||||
account.getPushSubscriptionManager().registerAccountForPush(null, true, endpoint.getUrl(), ks.getPubKey(), ks.getAuth());
|
account.getPushSubscriptionManager().registerAccountForPush(account.pushSubscription, true, endpoint.getUrl(), ks.getPubKey(), ks.getAuth());
|
||||||
} else {
|
} else {
|
||||||
// ks should never be null on new endpoint
|
// ks should never be null on new endpoint
|
||||||
account.getPushSubscriptionManager().registerAccountForPush(null, endpoint.getUrl());
|
account.getPushSubscriptionManager().registerAccountForPush(account.pushSubscription, endpoint.getUrl());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ public class SettingsNotificationsFragment extends BaseSettingsFragment<Void>{
|
|||||||
GlobalUserPreferences.save();
|
GlobalUserPreferences.save();
|
||||||
lp.keepOnlyLatestNotification=onlyLatestItem.checked;
|
lp.keepOnlyLatestNotification=onlyLatestItem.checked;
|
||||||
lp.save();
|
lp.save();
|
||||||
if(needUpdateNotificationSettings && PushSubscriptionManager.arePushNotificationsAvailable()){
|
if(needUpdateNotificationSettings && (PushSubscriptionManager.arePushNotificationsAvailable() || useUnifiedPush)){
|
||||||
ps.alerts.mention=mentionsItem.checked;
|
ps.alerts.mention=mentionsItem.checked;
|
||||||
ps.alerts.reblog=boostsItem.checked;
|
ps.alerts.reblog=boostsItem.checked;
|
||||||
ps.alerts.favourite=favoritesItem.checked;
|
ps.alerts.favourite=favoritesItem.checked;
|
||||||
|
|||||||
Reference in New Issue
Block a user