Search in sources :

Example 1 with MultiDeviceKeysUpdateJob

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());
    }
}
Also used : MultiDeviceContactUpdateJob(org.thoughtcrime.securesms.jobs.MultiDeviceContactUpdateJob) MultiDeviceGroupUpdateJob(org.thoughtcrime.securesms.jobs.MultiDeviceGroupUpdateJob) MultiDeviceConfigurationUpdateJob(org.thoughtcrime.securesms.jobs.MultiDeviceConfigurationUpdateJob) MultiDeviceKeysUpdateJob(org.thoughtcrime.securesms.jobs.MultiDeviceKeysUpdateJob) MultiDevicePniIdentityUpdateJob(org.thoughtcrime.securesms.jobs.MultiDevicePniIdentityUpdateJob) MultiDeviceBlockedUpdateJob(org.thoughtcrime.securesms.jobs.MultiDeviceBlockedUpdateJob) MultiDeviceStickerPackSyncJob(org.thoughtcrime.securesms.jobs.MultiDeviceStickerPackSyncJob)

Example 2 with MultiDeviceKeysUpdateJob

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());
    }
}
Also used : StorageForcePushJob(org.thoughtcrime.securesms.jobs.StorageForcePushJob) RefreshAttributesJob(org.thoughtcrime.securesms.jobs.RefreshAttributesJob) MultiDeviceStorageSyncRequestJob(org.thoughtcrime.securesms.jobs.MultiDeviceStorageSyncRequestJob) MultiDeviceKeysUpdateJob(org.thoughtcrime.securesms.jobs.MultiDeviceKeysUpdateJob) JobManager(org.thoughtcrime.securesms.jobmanager.JobManager)

Example 3 with MultiDeviceKeysUpdateJob

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());
    }
}
Also used : StorageSyncJob(org.thoughtcrime.securesms.jobs.StorageSyncJob) MultiDeviceKeysUpdateJob(org.thoughtcrime.securesms.jobs.MultiDeviceKeysUpdateJob) JobManager(org.thoughtcrime.securesms.jobmanager.JobManager)

Aggregations

MultiDeviceKeysUpdateJob (org.thoughtcrime.securesms.jobs.MultiDeviceKeysUpdateJob)3 JobManager (org.thoughtcrime.securesms.jobmanager.JobManager)2 MultiDeviceBlockedUpdateJob (org.thoughtcrime.securesms.jobs.MultiDeviceBlockedUpdateJob)1 MultiDeviceConfigurationUpdateJob (org.thoughtcrime.securesms.jobs.MultiDeviceConfigurationUpdateJob)1 MultiDeviceContactUpdateJob (org.thoughtcrime.securesms.jobs.MultiDeviceContactUpdateJob)1 MultiDeviceGroupUpdateJob (org.thoughtcrime.securesms.jobs.MultiDeviceGroupUpdateJob)1 MultiDevicePniIdentityUpdateJob (org.thoughtcrime.securesms.jobs.MultiDevicePniIdentityUpdateJob)1 MultiDeviceStickerPackSyncJob (org.thoughtcrime.securesms.jobs.MultiDeviceStickerPackSyncJob)1 MultiDeviceStorageSyncRequestJob (org.thoughtcrime.securesms.jobs.MultiDeviceStorageSyncRequestJob)1 RefreshAttributesJob (org.thoughtcrime.securesms.jobs.RefreshAttributesJob)1 StorageForcePushJob (org.thoughtcrime.securesms.jobs.StorageForcePushJob)1 StorageSyncJob (org.thoughtcrime.securesms.jobs.StorageSyncJob)1