mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 08:47:46 +00:00
Don't transmit SMS contact information to multi-device on change
Fixes #5710 // FREEBIE
This commit is contained in:
parent
2f9bf27ed7
commit
7d1c5a0d40
@ -40,6 +40,7 @@ import org.thoughtcrime.securesms.preferences.AdvancedRingtonePreference;
|
||||
import org.thoughtcrime.securesms.preferences.ColorPreference;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientFactory;
|
||||
import org.thoughtcrime.securesms.recipients.Recipients;
|
||||
import org.thoughtcrime.securesms.util.DirectoryHelper;
|
||||
import org.thoughtcrime.securesms.util.DynamicLanguage;
|
||||
import org.thoughtcrime.securesms.util.DynamicNoActionBarTheme;
|
||||
import org.thoughtcrime.securesms.util.DynamicTheme;
|
||||
@ -388,9 +389,13 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi
|
||||
DatabaseFactory.getRecipientPreferenceDatabase(context)
|
||||
.setColor(recipients, selectedColor);
|
||||
|
||||
ApplicationContext.getInstance(context)
|
||||
.getJobManager()
|
||||
.add(new MultiDeviceContactUpdateJob(context, recipients.getPrimaryRecipient().getRecipientId()));
|
||||
if (DirectoryHelper.getUserCapabilities(context, recipients)
|
||||
.getTextCapability() == DirectoryHelper.UserCapabilities.Capability.SUPPORTED)
|
||||
{
|
||||
ApplicationContext.getInstance(context)
|
||||
.getJobManager()
|
||||
.add(new MultiDeviceContactUpdateJob(context, recipients.getPrimaryRecipient().getRecipientId()));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}.execute();
|
||||
|
@ -19,6 +19,7 @@ import org.thoughtcrime.securesms.jobs.requirements.MasterSecretRequirement;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientFactory;
|
||||
import org.thoughtcrime.securesms.recipients.Recipients;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.whispersystems.jobqueue.JobParameters;
|
||||
import org.whispersystems.jobqueue.requirements.NetworkRequirement;
|
||||
import org.whispersystems.libsignal.util.guava.Optional;
|
||||
@ -69,6 +70,11 @@ public class MultiDeviceContactUpdateJob extends MasterSecretJob implements Inje
|
||||
public void onRun(MasterSecret masterSecret)
|
||||
throws IOException, UntrustedIdentityException, NetworkException
|
||||
{
|
||||
if (!TextSecurePreferences.isMultiDevice(context)) {
|
||||
Log.w(TAG, "Not multi device, aborting...");
|
||||
return;
|
||||
}
|
||||
|
||||
if (recipientId <= 0) generateFullContactUpdate();
|
||||
else generateSingleContactUpdate(recipientId);
|
||||
}
|
||||
@ -76,8 +82,8 @@ public class MultiDeviceContactUpdateJob extends MasterSecretJob implements Inje
|
||||
private void generateSingleContactUpdate(long recipientId)
|
||||
throws IOException, UntrustedIdentityException, NetworkException
|
||||
{
|
||||
SignalServiceMessageSender messageSender = messageSenderFactory.create();
|
||||
File contactDataFile = createTempFile("multidevice-contact-update");
|
||||
SignalServiceMessageSender messageSender = messageSenderFactory.create();
|
||||
File contactDataFile = createTempFile("multidevice-contact-update");
|
||||
|
||||
try {
|
||||
DeviceContactsOutputStream out = new DeviceContactsOutputStream(new FileOutputStream(contactDataFile));
|
||||
|
Loading…
x
Reference in New Issue
Block a user