mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-08 22:38:37 +00:00
Fix issue with contact syncing with attachmentsV3.
This commit is contained in:
parent
a33771b15d
commit
89a940ec81
@ -25,6 +25,7 @@ import org.thoughtcrime.securesms.providers.BlobProvider;
|
|||||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||||
import org.thoughtcrime.securesms.recipients.RecipientUtil;
|
import org.thoughtcrime.securesms.recipients.RecipientUtil;
|
||||||
|
import org.thoughtcrime.securesms.util.FeatureFlags;
|
||||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||||
import org.whispersystems.libsignal.IdentityKey;
|
import org.whispersystems.libsignal.IdentityKey;
|
||||||
import org.whispersystems.libsignal.util.guava.Optional;
|
import org.whispersystems.libsignal.util.guava.Optional;
|
||||||
@ -259,14 +260,17 @@ public class MultiDeviceContactUpdateJob extends BaseJob {
|
|||||||
throws UntrustedIdentityException, NetworkException
|
throws UntrustedIdentityException, NetworkException
|
||||||
{
|
{
|
||||||
if (length > 0) {
|
if (length > 0) {
|
||||||
SignalServiceAttachmentStream attachmentStream = SignalServiceAttachment.newStreamBuilder()
|
|
||||||
.withStream(stream)
|
|
||||||
.withContentType("application/octet-stream")
|
|
||||||
.withLength(length)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
try {
|
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));
|
UnidentifiedAccessUtil.getAccessForSync(context));
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
throw new NetworkException(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.GroupDatabase;
|
||||||
import org.thoughtcrime.securesms.database.IdentityDatabase;
|
import org.thoughtcrime.securesms.database.IdentityDatabase;
|
||||||
import org.thoughtcrime.securesms.database.ThreadDatabase;
|
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.logging.Log;
|
||||||
import org.thoughtcrime.securesms.mms.OutgoingExpirationUpdateMessage;
|
import org.thoughtcrime.securesms.mms.OutgoingExpirationUpdateMessage;
|
||||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||||
@ -96,6 +98,7 @@ final class ManageRecipientRepository {
|
|||||||
MaterialColor selectedColor = MaterialColors.CONVERSATION_PALETTE.getByColor(context, color);
|
MaterialColor selectedColor = MaterialColors.CONVERSATION_PALETTE.getByColor(context, color);
|
||||||
if (selectedColor != null) {
|
if (selectedColor != null) {
|
||||||
DatabaseFactory.getRecipientDatabase(context).setColor(recipientId, selectedColor);
|
DatabaseFactory.getRecipientDatabase(context).setColor(recipientId, selectedColor);
|
||||||
|
ApplicationDependencies.getJobManager().add(new MultiDeviceContactUpdateJob(recipientId));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user