Add GroupId for received messages.
// FREEBIE
This commit is contained in:
parent
83d65228e9
commit
d4493e700e
4 changed files with 7 additions and 4 deletions
|
@ -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)
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue