diff --git a/src/org/thoughtcrime/securesms/DatabaseUpgradeActivity.java b/src/org/thoughtcrime/securesms/DatabaseUpgradeActivity.java index e5ed28b9a9..5d3fc29553 100644 --- a/src/org/thoughtcrime/securesms/DatabaseUpgradeActivity.java +++ b/src/org/thoughtcrime/securesms/DatabaseUpgradeActivity.java @@ -206,7 +206,9 @@ public class DatabaseUpgradeActivity extends BaseActivity { while ((pushReader != null && pushReader.moveToNext())) { ApplicationContext.getInstance(getApplicationContext()) .getJobManager() - .add(new PushDecryptJob(getApplicationContext(), pushReader.getLong(pushReader.getColumnIndexOrThrow(PushDatabase.ID)))); + .add(new PushDecryptJob(getApplicationContext(), + pushReader.getLong(pushReader.getColumnIndexOrThrow(PushDatabase.ID)), + pushReader.getString(pushReader.getColumnIndexOrThrow(PushDatabase.SOURCE)))); } } finally { if (pushReader != null) diff --git a/src/org/thoughtcrime/securesms/ReceiveKeyActivity.java b/src/org/thoughtcrime/securesms/ReceiveKeyActivity.java index ec294f83bd..79fbc68c88 100644 --- a/src/org/thoughtcrime/securesms/ReceiveKeyActivity.java +++ b/src/org/thoughtcrime/securesms/ReceiveKeyActivity.java @@ -236,7 +236,7 @@ public class ReceiveKeyActivity extends BaseActivity { ApplicationContext.getInstance(context) .getJobManager() - .add(new PushDecryptJob(context, pushId)); + .add(new PushDecryptJob(context, pushId, message.getSender())); smsDatabase.deleteMessage(messageId); } catch (IOException e) { diff --git a/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java b/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java index 64ed7f366a..052d70697c 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java @@ -53,10 +53,11 @@ public class PushDecryptJob extends MasterSecretJob { private final long messageId; - public PushDecryptJob(Context context, long messageId) { + public PushDecryptJob(Context context, long messageId, String sender) { super(context, JobParameters.newBuilder() .withPersistence() .withRequirement(new MasterSecretRequirement(context)) + .withGroupId(sender) .create()); this.messageId = messageId; } diff --git a/src/org/thoughtcrime/securesms/jobs/PushReceiveJob.java b/src/org/thoughtcrime/securesms/jobs/PushReceiveJob.java index cbe3b2668a..652860ff37 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushReceiveJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushReceiveJob.java @@ -83,7 +83,7 @@ public class PushReceiveJob extends ContextJob { envelope.getRelay())); } - jobManager.add(new PushDecryptJob(context, messageId)); + jobManager.add(new PushDecryptJob(context, messageId, envelope.getSource())); } private void handleReceipt(TextSecureEnvelope envelope) {