X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/de273586b4106171a3940ce5ec2c2b3712430c8c..e3752e733adaad6f04c7d525e1b465a4b46474c7:/lib/src/main/java/org/asamk/signal/manager/HandleAction.java diff --git a/lib/src/main/java/org/asamk/signal/manager/HandleAction.java b/lib/src/main/java/org/asamk/signal/manager/HandleAction.java index 9d119c11..2396df06 100644 --- a/lib/src/main/java/org/asamk/signal/manager/HandleAction.java +++ b/lib/src/main/java/org/asamk/signal/manager/HandleAction.java @@ -1,8 +1,10 @@ package org.asamk.signal.manager; import org.asamk.signal.manager.groups.GroupIdV1; +import org.asamk.signal.manager.storage.recipients.RecipientId; import org.whispersystems.signalservice.api.push.SignalServiceAddress; +import java.util.List; import java.util.Objects; interface HandleAction { @@ -22,7 +24,7 @@ class SendReceiptAction implements HandleAction { @Override public void execute(Manager m) throws Throwable { - m.sendReceipt(address, timestamp); + m.sendDeliveryReceipt(address, List.of(timestamp)); } @Override @@ -157,3 +159,61 @@ class SendGroupInfoAction implements HandleAction { return result; } } + +class RetrieveProfileAction implements HandleAction { + + private final RecipientId recipientId; + + public RetrieveProfileAction(final RecipientId recipientId) { + this.recipientId = recipientId; + } + + @Override + public void execute(Manager m) throws Throwable { + m.getRecipientProfile(recipientId, true); + } + + @Override + public boolean equals(final Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + final RetrieveProfileAction that = (RetrieveProfileAction) o; + + return recipientId.equals(that.recipientId); + } + + @Override + public int hashCode() { + return recipientId.hashCode(); + } +} + +class RenewSessionAction implements HandleAction { + + private final RecipientId recipientId; + + public RenewSessionAction(final RecipientId recipientId) { + this.recipientId = recipientId; + } + + @Override + public void execute(Manager m) throws Throwable { + m.renewSession(recipientId); + } + + @Override + public boolean equals(final Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + final RenewSessionAction that = (RenewSessionAction) o; + + return recipientId.equals(that.recipientId); + } + + @Override + public int hashCode() { + return recipientId.hashCode(); + } +}