Search in sources :

Example 1 with MultiDeviceContactSyncJob

use of org.thoughtcrime.securesms.jobs.MultiDeviceContactSyncJob in project Signal-Android by WhisperSystems.

the class MessageContentProcessor method handleSynchronizeContacts.

private void handleSynchronizeContacts(@NonNull ContactsMessage contactsMessage, long envelopeTimestamp) throws IOException {
    if (SignalStore.account().isLinkedDevice()) {
        log(envelopeTimestamp, "Synchronize contacts.");
    } else {
        log(envelopeTimestamp, "Primary device ignores synchronize contacts.");
        return;
    }
    if (!(contactsMessage.getContactsStream() instanceof SignalServiceAttachmentPointer)) {
        warn(envelopeTimestamp, "No contact stream available.");
        return;
    }
    SignalServiceAttachmentPointer contactsAttachment = (SignalServiceAttachmentPointer) contactsMessage.getContactsStream();
    ApplicationDependencies.getJobManager().add(new MultiDeviceContactSyncJob(contactsAttachment));
}
Also used : MultiDeviceContactSyncJob(org.thoughtcrime.securesms.jobs.MultiDeviceContactSyncJob) SignalServiceAttachmentPointer(org.whispersystems.signalservice.api.messages.SignalServiceAttachmentPointer)

Aggregations

MultiDeviceContactSyncJob (org.thoughtcrime.securesms.jobs.MultiDeviceContactSyncJob)1 SignalServiceAttachmentPointer (org.whispersystems.signalservice.api.messages.SignalServiceAttachmentPointer)1