]>
nmode's Git Repositories - signal-cli/blob - lib/src/main/java/org/asamk/signal/manager/actions/SendReceiptAction.java
1 package org
.asamk
.signal
.manager
.actions
;
3 import org
.asamk
.signal
.manager
.jobs
.Context
;
4 import org
.asamk
.signal
.manager
.storage
.recipients
.RecipientId
;
7 import java
.util
.Objects
;
9 public class SendReceiptAction
implements HandleAction
{
11 private final RecipientId recipientId
;
12 private final long timestamp
;
14 public SendReceiptAction(final RecipientId recipientId
, final long timestamp
) {
15 this.recipientId
= recipientId
;
16 this.timestamp
= timestamp
;
20 public void execute(Context context
) throws Throwable
{
21 context
.getSendHelper().sendDeliveryReceipt(recipientId
, List
.of(timestamp
));
25 public boolean equals(final Object o
) {
26 if (this == o
) return true;
27 if (o
== null || getClass() != o
.getClass()) return false;
28 final var that
= (SendReceiptAction
) o
;
29 return timestamp
== that
.timestamp
&& recipientId
.equals(that
.recipientId
);
33 public int hashCode() {
34 return Objects
.hash(recipientId
, timestamp
);