diff options
Diffstat (limited to 'src/org/traccar/database/NotificationManager.java')
-rw-r--r-- | src/org/traccar/database/NotificationManager.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/org/traccar/database/NotificationManager.java b/src/org/traccar/database/NotificationManager.java index 48caa615c..0987f255b 100644 --- a/src/org/traccar/database/NotificationManager.java +++ b/src/org/traccar/database/NotificationManager.java @@ -49,7 +49,7 @@ public class NotificationManager { public void updateEvent(Event event, Position position) { try { - dataManager.addEvent(event); + dataManager.addObject(event); } catch (SQLException error) { Log.warning(error); } @@ -57,7 +57,7 @@ public class NotificationManager { Set<Long> users = Context.getPermissionsManager().getDeviceUsers(event.getDeviceId()); for (long userId : users) { if (event.getGeofenceId() == 0 || Context.getGeofenceManager() != null - && Context.getGeofenceManager().checkGeofence(userId, event.getGeofenceId())) { + && Context.getGeofenceManager().checkItemPermission(userId, event.getGeofenceId())) { Notification notification = getUserNotificationByType(userId, event.getType()); if (notification != null) { if (notification.getWeb()) { @@ -105,7 +105,7 @@ public class NotificationManager { notificationsLock.writeLock().lock(); try { userNotifications.clear(); - for (Notification notification : dataManager.getNotifications()) { + for (Notification notification : dataManager.getObjects(Notification.class)) { getUserNotificationsUnsafe(notification.getUserId()).add(notification); } } finally { @@ -139,7 +139,7 @@ public class NotificationManager { || cachedNotification.getSms() != notification.getSms()) { if (!notification.getWeb() && !notification.getMail() && !notification.getSms()) { try { - dataManager.removeNotification(cachedNotification); + dataManager.removeObject(Notification.class, cachedNotification.getId()); } catch (SQLException error) { Log.warning(error); } @@ -160,7 +160,7 @@ public class NotificationManager { notificationsLock.writeLock().unlock(); } try { - dataManager.updateNotification(cachedNotification); + dataManager.updateObject(cachedNotification); } catch (SQLException error) { Log.warning(error); } @@ -170,7 +170,7 @@ public class NotificationManager { } } else if (notification.getWeb() || notification.getMail() || notification.getSms()) { try { - dataManager.addNotification(notification); + dataManager.addObject(notification); } catch (SQLException error) { Log.warning(error); } |