Skip to content

Commit

Permalink
Allow configuring push notifications with UnifiedPush
Browse files Browse the repository at this point in the history
  • Loading branch information
p1gp1g committed Jan 15, 2025
1 parent 7cd756f commit 5648b8b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ public void onNewEndpoint(@NotNull Context context, @NotNull PushEndpoint endpoi
if (account != null) {
PublicKeySet ks = endpoint.getPubKeySet();
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 {
// ks should never be null on new endpoint
account.getPushSubscriptionManager().registerAccountForPush(null, endpoint.getUrl());
account.getPushSubscriptionManager().registerAccountForPush(account.pushSubscription, endpoint.getUrl());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ protected void onHidden(){
GlobalUserPreferences.save();
lp.keepOnlyLatestNotification=onlyLatestItem.checked;
lp.save();
if(needUpdateNotificationSettings && PushSubscriptionManager.arePushNotificationsAvailable()){
if(needUpdateNotificationSettings && (PushSubscriptionManager.arePushNotificationsAvailable() || UnifiedPushHelper.isUnifiedPushEnabled(getContext()))){
ps.alerts.mention=mentionsItem.checked;
ps.alerts.reblog=boostsItem.checked;
ps.alerts.favourite=favoritesItem.checked;
Expand Down

0 comments on commit 5648b8b

Please sign in to comment.