diff options
Diffstat (limited to 'src/org/traccar/database')
-rw-r--r-- | src/org/traccar/database/CommandsManager.java | 6 | ||||
-rw-r--r-- | src/org/traccar/database/NotificationManager.java | 11 |
2 files changed, 8 insertions, 9 deletions
diff --git a/src/org/traccar/database/CommandsManager.java b/src/org/traccar/database/CommandsManager.java index 9ceb995ef..2e68fae5a 100644 --- a/src/org/traccar/database/CommandsManager.java +++ b/src/org/traccar/database/CommandsManager.java @@ -58,10 +58,10 @@ public class CommandsManager extends ExtendedObjectManager<Command> { BaseProtocol protocol = Context.getServerManager().getProtocol(lastPosition.getProtocol()); protocol.sendTextCommand(phone, command); } else if (command.getType().equals(Command.TYPE_CUSTOM)) { - if (Context.getSmppManager() != null) { - Context.getSmppManager().sendMessageSync(phone, command.getString(Command.KEY_DATA), true); + if (Context.getSmsManager() != null) { + Context.getSmsManager().sendMessageSync(phone, command.getString(Command.KEY_DATA), true); } else { - throw new RuntimeException("SMPP client is not enabled"); + throw new RuntimeException("SMS is not enabled"); } } else { throw new RuntimeException("Command " + command.getType() + " is not supported"); diff --git a/src/org/traccar/database/NotificationManager.java b/src/org/traccar/database/NotificationManager.java index 1c59a8666..1295b5b0c 100644 --- a/src/org/traccar/database/NotificationManager.java +++ b/src/org/traccar/database/NotificationManager.java @@ -32,8 +32,7 @@ import org.traccar.model.Event; import org.traccar.model.Notification; import org.traccar.model.Position; import org.traccar.model.Typed; -import org.traccar.notification.NotificationMail; -import org.traccar.notification.NotificationSms; +import org.traccar.notification.NotificatorManager; public class NotificationManager extends ExtendedObjectManager<Notification> { @@ -85,20 +84,20 @@ public class NotificationManager extends ExtendedObjectManager<Notification> { } boolean sentWeb = false; boolean sentMail = false; - boolean sentSms = Context.getSmppManager() == null; + boolean sentSms = Context.getSmsManager() == null; for (long notificationId : getEffectiveNotifications(userId, deviceId, event.getServerTime())) { Notification notification = getById(notificationId); if (getById(notificationId).getType().equals(event.getType())) { if (!sentWeb && notification.getWeb()) { - Context.getConnectionManager().updateEvent(userId, event); + NotificatorManager.getWeb().sendAsync(userId, event, position); sentWeb = true; } if (!sentMail && notification.getMail()) { - NotificationMail.sendMailAsync(userId, event, position); + NotificatorManager.getMail().sendAsync(userId, event, position); sentMail = true; } if (!sentSms && notification.getSms()) { - NotificationSms.sendSmsAsync(userId, event, position); + NotificatorManager.getSms().sendAsync(userId, event, position); sentSms = true; } } |