]>
nmode's Git Repositories - signal-cli/blob - lib/src/main/java/org/asamk/signal/manager/actions/RenewSessionAction.java
1 package org
.asamk
.signal
.manager
.actions
;
3 import org
.asamk
.signal
.manager
.helper
.Context
;
4 import org
.asamk
.signal
.manager
.storage
.recipients
.RecipientId
;
5 import org
.whispersystems
.signalservice
.api
.push
.ServiceId
;
7 public class RenewSessionAction
implements HandleAction
{
9 private final RecipientId recipientId
;
10 private final ServiceId serviceId
;
11 private final ServiceId accountId
;
13 public RenewSessionAction(final RecipientId recipientId
, final ServiceId serviceId
, final ServiceId accountId
) {
14 this.recipientId
= recipientId
;
15 this.serviceId
= serviceId
;
16 this.accountId
= accountId
;
20 public void execute(Context context
) throws Throwable
{
21 context
.getAccount().getAccountData(accountId
).getSessionStore().archiveSessions(serviceId
);
22 context
.getSendHelper().sendNullMessage(recipientId
);
26 public boolean equals(final Object o
) {
27 if (this == o
) return true;
28 if (o
== null || getClass() != o
.getClass()) return false;
30 final RenewSessionAction that
= (RenewSessionAction
) o
;
32 return recipientId
.equals(that
.recipientId
);
36 public int hashCode() {
37 return recipientId
.hashCode();