]> nmode's Git Repositories - signal-cli/blobdiff - lib/src/main/java/org/asamk/signal/manager/actions/RefreshPreKeysAction.java
Refresh prekeys after receiving a pre key message, if necessary
[signal-cli] / lib / src / main / java / org / asamk / signal / manager / actions / RefreshPreKeysAction.java
diff --git a/lib/src/main/java/org/asamk/signal/manager/actions/RefreshPreKeysAction.java b/lib/src/main/java/org/asamk/signal/manager/actions/RefreshPreKeysAction.java
new file mode 100644 (file)
index 0000000..82d0d29
--- /dev/null
@@ -0,0 +1,20 @@
+package org.asamk.signal.manager.actions;
+
+import org.asamk.signal.manager.jobs.Context;
+
+public class RefreshPreKeysAction implements HandleAction {
+
+    private static final RefreshPreKeysAction INSTANCE = new RefreshPreKeysAction();
+
+    private RefreshPreKeysAction() {
+    }
+
+    public static RefreshPreKeysAction create() {
+        return INSTANCE;
+    }
+
+    @Override
+    public void execute(Context context) throws Throwable {
+        context.getPreKeyHelper().refreshPreKeysIfNecessary();
+    }
+}