Loading app/src/main/java/app/fedilab/android/mastodon/helper/NotificationsHelper.java +26 −12 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ import retrofit2.converter.gson.GsonConverterFactory; public class NotificationsHelper { public static HashMap<String, String> since_ids = new HashMap<>(); public static HashMap<String, List<String>> pushed_notifications = new HashMap<>(); public static synchronized void task(Context context, String slug) throws DBException { Loading Loading @@ -184,6 +185,19 @@ public class NotificationsHelper { //No previous notifications in cache, so no notification will be sent for (Notification notification : notifications) { List<String> notificationIDList; if (pushed_notifications.containsKey(key)) { notificationIDList = pushed_notifications.get(key); if (notificationIDList != null && notificationIDList.contains(notification.id)) { continue; } } notificationIDList = pushed_notifications.get(key); if (notificationIDList == null) { notificationIDList = new ArrayList<>(); } notificationIDList.add(notification.id); pushed_notifications.put(key, notificationIDList); String notificationUrl; String title = null; String message = null; Loading Loading
app/src/main/java/app/fedilab/android/mastodon/helper/NotificationsHelper.java +26 −12 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ import retrofit2.converter.gson.GsonConverterFactory; public class NotificationsHelper { public static HashMap<String, String> since_ids = new HashMap<>(); public static HashMap<String, List<String>> pushed_notifications = new HashMap<>(); public static synchronized void task(Context context, String slug) throws DBException { Loading Loading @@ -184,6 +185,19 @@ public class NotificationsHelper { //No previous notifications in cache, so no notification will be sent for (Notification notification : notifications) { List<String> notificationIDList; if (pushed_notifications.containsKey(key)) { notificationIDList = pushed_notifications.get(key); if (notificationIDList != null && notificationIDList.contains(notification.id)) { continue; } } notificationIDList = pushed_notifications.get(key); if (notificationIDList == null) { notificationIDList = new ArrayList<>(); } notificationIDList.add(notification.id); pushed_notifications.put(key, notificationIDList); String notificationUrl; String title = null; String message = null; Loading