aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/notificators
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-02-24 10:45:26 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2019-02-24 10:45:26 -0800
commit98993ee219b6c0cb31f2f3b1608d378b2e028535 (patch)
tree77a6e8366c27b8b3851e52b6ab81ff62920b970c /src/org/traccar/notificators
parenta129cfd3159c02b4f3996dbdfb5299ac95a6720c (diff)
downloadtrackermap-server-98993ee219b6c0cb31f2f3b1608d378b2e028535.tar.gz
trackermap-server-98993ee219b6c0cb31f2f3b1608d378b2e028535.tar.bz2
trackermap-server-98993ee219b6c0cb31f2f3b1608d378b2e028535.zip
Refactor geolocation
Diffstat (limited to 'src/org/traccar/notificators')
-rw-r--r--src/org/traccar/notificators/NotificatorSms.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/org/traccar/notificators/NotificatorSms.java b/src/org/traccar/notificators/NotificatorSms.java
index d4052c626..d5c791eae 100644
--- a/src/org/traccar/notificators/NotificatorSms.java
+++ b/src/org/traccar/notificators/NotificatorSms.java
@@ -17,6 +17,8 @@
package org.traccar.notificators;
import org.traccar.Context;
+import org.traccar.Main;
+import org.traccar.database.StatisticsManager;
import org.traccar.model.Event;
import org.traccar.model.Position;
import org.traccar.model.User;
@@ -41,7 +43,7 @@ public final class NotificatorSms extends Notificator {
public void sendAsync(long userId, Event event, Position position) {
final User user = Context.getPermissionsManager().getUser(userId);
if (user.getPhone() != null) {
- Context.getStatisticsManager().registerSms();
+ Main.getInjector().getInstance(StatisticsManager.class).registerSms();
smsManager.sendMessageAsync(user.getPhone(),
NotificationFormatter.formatShortMessage(userId, event, position), false);
}
@@ -51,7 +53,7 @@ public final class NotificatorSms extends Notificator {
public void sendSync(long userId, Event event, Position position) throws MessageException, InterruptedException {
final User user = Context.getPermissionsManager().getUser(userId);
if (user.getPhone() != null) {
- Context.getStatisticsManager().registerSms();
+ Main.getInjector().getInstance(StatisticsManager.class).registerSms();
smsManager.sendMessageSync(user.getPhone(),
NotificationFormatter.formatShortMessage(userId, event, position), false);
}