Fix issue with contact syncing with attachmentsV3.
This commit is contained in:
parent
a33771b15d
commit
89a940ec81
2 changed files with 14 additions and 7 deletions
|
@ -25,6 +25,7 @@ import org.thoughtcrime.securesms.providers.BlobProvider;
|
|||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientUtil;
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.whispersystems.libsignal.IdentityKey;
|
||||
import org.whispersystems.libsignal.util.guava.Optional;
|
||||
|
@ -259,14 +260,17 @@ public class MultiDeviceContactUpdateJob extends BaseJob {
|
|||
throws UntrustedIdentityException, NetworkException
|
||||
{
|
||||
if (length > 0) {
|
||||
SignalServiceAttachmentStream attachmentStream = SignalServiceAttachment.newStreamBuilder()
|
||||
.withStream(stream)
|
||||
.withContentType("application/octet-stream")
|
||||
.withLength(length)
|
||||
.build();
|
||||
|
||||
try {
|
||||
messageSender.sendMessage(SignalServiceSyncMessage.forContacts(new ContactsMessage(attachmentStream, complete)),
|
||||
SignalServiceAttachmentStream.Builder attachmentStream = SignalServiceAttachment.newStreamBuilder()
|
||||
.withStream(stream)
|
||||
.withContentType("application/octet-stream")
|
||||
.withLength(length);
|
||||
|
||||
if (FeatureFlags.attachmentsV3()) {
|
||||
attachmentStream.withResumableUploadSpec(messageSender.getResumableUploadSpec());
|
||||
}
|
||||
|
||||
messageSender.sendMessage(SignalServiceSyncMessage.forContacts(new ContactsMessage(attachmentStream.build(), complete)),
|
||||
UnidentifiedAccessUtil.getAccessForSync(context));
|
||||
} catch (IOException ioe) {
|
||||
throw new NetworkException(ioe);
|
||||
|
|
|
@ -15,6 +15,8 @@ import org.thoughtcrime.securesms.database.DatabaseFactory;
|
|||
import org.thoughtcrime.securesms.database.GroupDatabase;
|
||||
import org.thoughtcrime.securesms.database.IdentityDatabase;
|
||||
import org.thoughtcrime.securesms.database.ThreadDatabase;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.jobs.MultiDeviceContactUpdateJob;
|
||||
import org.thoughtcrime.securesms.logging.Log;
|
||||
import org.thoughtcrime.securesms.mms.OutgoingExpirationUpdateMessage;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
|
@ -96,6 +98,7 @@ final class ManageRecipientRepository {
|
|||
MaterialColor selectedColor = MaterialColors.CONVERSATION_PALETTE.getByColor(context, color);
|
||||
if (selectedColor != null) {
|
||||
DatabaseFactory.getRecipientDatabase(context).setColor(recipientId, selectedColor);
|
||||
ApplicationDependencies.getJobManager().add(new MultiDeviceContactUpdateJob(recipientId));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue