use of org.thoughtcrime.securesms.jobs.MultiDeviceKeysUpdateJob in project Signal-Android by WhisperSystems.
the class MessageContentProcessor method handleSynchronizeRequestMessage.
private void handleSynchronizeRequestMessage(@NonNull RequestMessage message, long envelopeTimestamp) {
if (SignalStore.account().isPrimaryDevice()) {
log(envelopeTimestamp, "Synchronize request message.");
} else {
log(envelopeTimestamp, "Linked device ignoring synchronize request message.");
return;
}
if (message.isContactsRequest()) {
ApplicationDependencies.getJobManager().add(new MultiDeviceContactUpdateJob(true));
}
if (message.isGroupsRequest()) {
ApplicationDependencies.getJobManager().add(new MultiDeviceGroupUpdateJob());
}
if (message.isBlockedListRequest()) {
ApplicationDependencies.getJobManager().add(new MultiDeviceBlockedUpdateJob());
}
if (message.isConfigurationRequest()) {
ApplicationDependencies.getJobManager().add(new MultiDeviceConfigurationUpdateJob(TextSecurePreferences.isReadReceiptsEnabled(context), TextSecurePreferences.isTypingIndicatorsEnabled(context), TextSecurePreferences.isShowUnidentifiedDeliveryIndicatorsEnabled(context), SignalStore.settings().isLinkPreviewsEnabled()));
ApplicationDependencies.getJobManager().add(new MultiDeviceStickerPackSyncJob());
}
if (message.isKeysRequest()) {
ApplicationDependencies.getJobManager().add(new MultiDeviceKeysUpdateJob());
}
if (message.isPniIdentityRequest()) {
ApplicationDependencies.getJobManager().add(new MultiDevicePniIdentityUpdateJob());
}
}
use of org.thoughtcrime.securesms.jobs.MultiDeviceKeysUpdateJob in project Signal-Android by WhisperSystems.
the class StorageCapabilityMigrationJob method performMigration.
@Override
public void performMigration() {
JobManager jobManager = ApplicationDependencies.getJobManager();
jobManager.add(new RefreshAttributesJob());
if (TextSecurePreferences.isMultiDevice(context)) {
Log.i(TAG, "Multi-device.");
jobManager.startChain(new StorageForcePushJob()).then(new MultiDeviceKeysUpdateJob()).then(new MultiDeviceStorageSyncRequestJob()).enqueue();
} else {
Log.i(TAG, "Single-device.");
jobManager.add(new StorageForcePushJob());
}
}
use of org.thoughtcrime.securesms.jobs.MultiDeviceKeysUpdateJob in project Signal-Android by WhisperSystems.
the class StorageServiceMigrationJob method performMigration.
@Override
public void performMigration() {
if (SignalStore.account().getAci() == null) {
Log.w(TAG, "Self not yet available.");
return;
}
SignalDatabase.recipients().markNeedsSync(Recipient.self().getId());
JobManager jobManager = ApplicationDependencies.getJobManager();
if (TextSecurePreferences.isMultiDevice(context)) {
Log.i(TAG, "Multi-device.");
jobManager.startChain(new StorageSyncJob()).then(new MultiDeviceKeysUpdateJob()).enqueue();
} else {
Log.i(TAG, "Single-device.");
jobManager.add(new StorageSyncJob());
}
}
Aggregations