Save the SMS setting on a per-conversation basis.

This commit is contained in:
Alan Evans
2019-04-12 16:22:38 -03:00
committed by Greyson Parrelli
parent 11a2ed0743
commit 9c40de5bf1
6 changed files with 71 additions and 12 deletions

View File

@@ -284,6 +284,8 @@ public class PushDecryptJob extends ContextJob {
Log.w(TAG, "Got unrecognized message...");
}
resetRecipientToPush(Recipient.from(context, Address.fromExternal(context, content.getSender()), false));
if (envelope.isPreKeySignalMessage()) {
ApplicationContext.getInstance(context).getJobManager().add(new RefreshPreKeysJob(context));
}
@@ -1163,6 +1165,12 @@ public class PushDecryptJob extends ContextJob {
return false;
}
private void resetRecipientToPush(@NonNull Recipient recipient) {
if (recipient.isForceSmsSelection()) {
DatabaseFactory.getRecipientDatabase(context).setForceSmsSelection(recipient, false);
}
}
@SuppressWarnings("WeakerAccess")
private static class StorageFailedException extends Exception {
private final String sender;