diff --git a/app/build.gradle b/app/build.gradle index 5efca00f..2046c73d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -13,8 +13,8 @@ android { defaultConfig { minSdk 21 targetSdk 33 - versionCode 461 - versionName "3.13.7" + versionCode 462 + versionName "3.14.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } flavorDimensions "default" diff --git a/app/src/main/assets/release_notes/notes.json b/app/src/main/assets/release_notes/notes.json index 35d084d4..c55a9703 100644 --- a/app/src/main/assets/release_notes/notes.json +++ b/app/src/main/assets/release_notes/notes.json @@ -1,4 +1,9 @@ [ + { + "version": "3.14.0", + "code": "462", + "note": "Added:\n\n- Add Bubble timeline support in extra-features with filters\n- Allow to display public profiles by default to get all messages (Settings > Interface)\n- Glitch: Allow to post messages locally (Can be turned off in Settings)\n- Pixelfed: Custom layout to display Media fully (Also works for other software when there are media)\n- Allow to align left action buttons in messages\n\nChanged:\n- Full rework on links in messages (also mentions and tags)\n- Add pinned tag in \"any\" to avoid to lose it when renaming timeline\n\nFixed:\n- Links to messages not handled by the app\n- CW when editing a message\n- Fix push notifications with several accounts\n- New messages or edition notifications not pushed\n- Fix quotes with tags/mentions\n- Fix notifications\n- Fix sending multiple media\n- Fix crashes" + }, { "version": "3.13.7", "code": "461", diff --git a/app/src/main/java/app/fedilab/android/client/endpoints/MastodonNotificationsService.java b/app/src/main/java/app/fedilab/android/client/endpoints/MastodonNotificationsService.java index d6f2f15a..898359fb 100644 --- a/app/src/main/java/app/fedilab/android/client/endpoints/MastodonNotificationsService.java +++ b/app/src/main/java/app/fedilab/android/client/endpoints/MastodonNotificationsService.java @@ -71,7 +71,12 @@ public interface MastodonNotificationsService { @Field("data[alerts][favourite]") boolean favourite, @Field("data[alerts][reblog]") boolean reblog, @Field("data[alerts][mention]") boolean mention, - @Field("data[alerts][poll]") boolean poll + @Field("data[alerts][poll]") boolean poll, + @Field("data[alerts][status]") boolean status, + @Field("data[alerts][update]") boolean update, + @Field("data[alerts][admin.sign_up]") boolean admin_sign_up, + @Field("data[alerts][admin.report]") boolean admin_report + ); @GET("push/subscription") diff --git a/app/src/main/java/app/fedilab/android/helper/NotificationsHelper.java b/app/src/main/java/app/fedilab/android/helper/NotificationsHelper.java index 18a81cfb..4473d48f 100644 --- a/app/src/main/java/app/fedilab/android/helper/NotificationsHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/NotificationsHelper.java @@ -90,8 +90,13 @@ public class NotificationsHelper { boolean notif_share = prefs.getBoolean(context.getString(R.string.SET_NOTIF_SHARE), true); boolean notif_poll = prefs.getBoolean(context.getString(R.string.SET_NOTIF_POLL), true); boolean notif_fav = prefs.getBoolean(context.getString(R.string.SET_NOTIF_FAVOURITE), true); + boolean notif_status = prefs.getBoolean(context.getString(R.string.SET_NOTIF_STATUS), true); + boolean notif_updates = prefs.getBoolean(context.getString(R.string.SET_NOTIF_UPDATE), true); + boolean notif_signup = prefs.getBoolean(context.getString(R.string.SET_NOTIF_ADMIN_SIGNUP), true); + boolean notif_report = prefs.getBoolean(context.getString(R.string.SET_NOTIF_ADMIN_REPORT), true); + //User disagree with all notifications - if (!notif_follow && !notif_fav && !notif_mention && !notif_share && !notif_poll) + if (!notif_follow && !notif_fav && !notif_mention && !notif_share && !notif_poll && !notif_status && !notif_updates && !notif_signup && !notif_report) return; //Nothing is done MastodonNotificationsService mastodonNotificationsService = init(context, slugArray[1]); diff --git a/app/src/main/java/app/fedilab/android/helper/PushNotifications.java b/app/src/main/java/app/fedilab/android/helper/PushNotifications.java index a2be75ea..eda24259 100644 --- a/app/src/main/java/app/fedilab/android/helper/PushNotifications.java +++ b/app/src/main/java/app/fedilab/android/helper/PushNotifications.java @@ -64,6 +64,10 @@ public class PushNotifications { boolean notif_share = prefs.getBoolean(context.getString(R.string.SET_NOTIF_SHARE), true); boolean notif_poll = prefs.getBoolean(context.getString(R.string.SET_NOTIF_POLL), true); boolean notif_fav = prefs.getBoolean(context.getString(R.string.SET_NOTIF_FAVOURITE), true); + boolean notif_status = prefs.getBoolean(context.getString(R.string.SET_NOTIF_STATUS), true); + boolean notif_updates = prefs.getBoolean(context.getString(R.string.SET_NOTIF_UPDATE), true); + boolean notif_signup = prefs.getBoolean(context.getString(R.string.SET_NOTIF_ADMIN_SIGNUP), true); + boolean notif_report = prefs.getBoolean(context.getString(R.string.SET_NOTIF_ADMIN_REPORT), true); new Thread(() -> { String[] slugArray = slug.split("@"); BaseAccount accountDb = null; @@ -87,7 +91,11 @@ public class PushNotifications { notif_fav, notif_share, notif_mention, - notif_poll); + notif_poll, + notif_status, + notif_updates, + notif_signup, + notif_report); if (pushSubscriptionCall != null) { try { Response pushSubscriptionResponse = pushSubscriptionCall.execute(); diff --git a/app/src/main/java/app/fedilab/android/viewmodel/mastodon/NotificationsVM.java b/app/src/main/java/app/fedilab/android/viewmodel/mastodon/NotificationsVM.java index d7ee2dd4..02e63b43 100644 --- a/app/src/main/java/app/fedilab/android/viewmodel/mastodon/NotificationsVM.java +++ b/app/src/main/java/app/fedilab/android/viewmodel/mastodon/NotificationsVM.java @@ -304,12 +304,17 @@ public class NotificationsVM extends AndroidViewModel { boolean favourite, boolean reblog, boolean mention, - boolean poll) { + boolean poll, + boolean status, + boolean updates, + boolean signup, + boolean report + ) { pushSubscriptionMutableLiveData = new MutableLiveData<>(); MastodonNotificationsService mastodonNotificationsService = init(instance); new Thread(() -> { PushSubscription pushSubscription = null; - Call pushSubscriptionCall = mastodonNotificationsService.pushSubscription(token, endpoint, keys_p256dh, keys_auth, follow, favourite, reblog, mention, poll); + Call pushSubscriptionCall = mastodonNotificationsService.pushSubscription(token, endpoint, keys_p256dh, keys_auth, follow, favourite, reblog, mention, poll, status, updates, signup, report); if (pushSubscriptionCall != null) { try { Response pushSubscriptionResponse = pushSubscriptionCall.execute(); diff --git a/src/fdroid/fastlane/metadata/android/en/changelogs/462.txt b/src/fdroid/fastlane/metadata/android/en/changelogs/462.txt index ed771005..f737820e 100644 --- a/src/fdroid/fastlane/metadata/android/en/changelogs/462.txt +++ b/src/fdroid/fastlane/metadata/android/en/changelogs/462.txt @@ -14,6 +14,7 @@ Fixed: - Links to messages not handled by the app - CW when editing a message - Fix push notifications with several accounts +- New messages or edition notifications not pushed - Fix quotes with tags/mentions - Fix notifications - Fix sending multiple media