]> nmode's Git Repositories - signal-cli/blob - lib/src/main/java/org/asamk/signal/manager/actions/SendProfileKeyAction.java
Update libsignal-service-java
[signal-cli] / lib / src / main / java / org / asamk / signal / manager / actions / SendProfileKeyAction.java
1 package org.asamk.signal.manager.actions;
2
3 import org.asamk.signal.manager.helper.Context;
4 import org.asamk.signal.manager.storage.recipients.RecipientId;
5
6 import java.util.Objects;
7
8 public class SendProfileKeyAction implements HandleAction {
9
10 private final RecipientId recipientId;
11
12 public SendProfileKeyAction(final RecipientId recipientId) {
13 this.recipientId = recipientId;
14 }
15
16 @Override
17 public void execute(Context context) throws Throwable {
18 context.getSendHelper().sendProfileKey(recipientId);
19 }
20
21 @Override
22 public boolean equals(final Object o) {
23 if (this == o) return true;
24 if (o == null || getClass() != o.getClass()) return false;
25 final SendProfileKeyAction that = (SendProfileKeyAction) o;
26 return recipientId.equals(that.recipientId);
27 }
28
29 @Override
30 public int hashCode() {
31 return Objects.hash(recipientId);
32 }
33 }