mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 02:20:39 +00:00
Add who am I job
This commit is contained in:
parent
d844e0f396
commit
5cac7feabe
2 changed files with 24 additions and 1 deletions
|
@ -6,6 +6,7 @@ import org.asamk.signal.manager.api.PhoneNumberSharingMode;
|
|||
import org.asamk.signal.manager.api.Profile;
|
||||
import org.asamk.signal.manager.api.TrustLevel;
|
||||
import org.asamk.signal.manager.internal.SignalDependencies;
|
||||
import org.asamk.signal.manager.jobs.CheckWhoAmIJob;
|
||||
import org.asamk.signal.manager.jobs.DownloadProfileAvatarJob;
|
||||
import org.asamk.signal.manager.storage.SignalAccount;
|
||||
import org.asamk.signal.manager.storage.recipients.RecipientAddress;
|
||||
|
@ -251,7 +252,7 @@ public class StorageHelper {
|
|||
}
|
||||
|
||||
if (!accountRecord.getE164().equals(account.getNumber())) {
|
||||
context.getAccountHelper().checkWhoAmiI();
|
||||
context.getJobExecutor().enqueueJob(new CheckWhoAmIJob());
|
||||
}
|
||||
|
||||
account.getConfigurationStore().setReadReceipts(accountRecord.isReadReceiptsEnabled());
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
package org.asamk.signal.manager.jobs;
|
||||
|
||||
import org.asamk.signal.manager.helper.Context;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class CheckWhoAmIJob implements Job {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(CheckWhoAmIJob.class);
|
||||
|
||||
@Override
|
||||
public void run(Context context) {
|
||||
logger.trace("Checking whoAmI");
|
||||
try {
|
||||
context.getAccountHelper().checkWhoAmiI();
|
||||
} catch (IOException e) {
|
||||
logger.warn("Failed to check whoAmI", e);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue