Search in sources :

Example 1 with MultiDeviceGroupUpdateJob

use of org.thoughtcrime.securesms.jobs.MultiDeviceGroupUpdateJob 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 MultiDeviceGroupUpdateJob

use of org.thoughtcrime.securesms.jobs.MultiDeviceGroupUpdateJob in project Signal-Android by signalapp.

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)

Aggregations

MultiDeviceBlockedUpdateJob (org.thoughtcrime.securesms.jobs.MultiDeviceBlockedUpdateJob)2 MultiDeviceConfigurationUpdateJob (org.thoughtcrime.securesms.jobs.MultiDeviceConfigurationUpdateJob)2 MultiDeviceContactUpdateJob (org.thoughtcrime.securesms.jobs.MultiDeviceContactUpdateJob)2 MultiDeviceGroupUpdateJob (org.thoughtcrime.securesms.jobs.MultiDeviceGroupUpdateJob)2 MultiDeviceKeysUpdateJob (org.thoughtcrime.securesms.jobs.MultiDeviceKeysUpdateJob)2 MultiDevicePniIdentityUpdateJob (org.thoughtcrime.securesms.jobs.MultiDevicePniIdentityUpdateJob)2 MultiDeviceStickerPackSyncJob (org.thoughtcrime.securesms.jobs.MultiDeviceStickerPackSyncJob)2