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())) {
|
while ((pushReader != null && pushReader.moveToNext())) {
|
||||||
ApplicationContext.getInstance(getApplicationContext())
|
ApplicationContext.getInstance(getApplicationContext())
|
||||||
.getJobManager()
|
.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 {
|
} finally {
|
||||||
if (pushReader != null)
|
if (pushReader != null)
|
||||||
|
|
|
@ -236,7 +236,7 @@ public class ReceiveKeyActivity extends BaseActivity {
|
||||||
|
|
||||||
ApplicationContext.getInstance(context)
|
ApplicationContext.getInstance(context)
|
||||||
.getJobManager()
|
.getJobManager()
|
||||||
.add(new PushDecryptJob(context, pushId));
|
.add(new PushDecryptJob(context, pushId, message.getSender()));
|
||||||
|
|
||||||
smsDatabase.deleteMessage(messageId);
|
smsDatabase.deleteMessage(messageId);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
|
@ -53,10 +53,11 @@ public class PushDecryptJob extends MasterSecretJob {
|
||||||
|
|
||||||
private final long messageId;
|
private final long messageId;
|
||||||
|
|
||||||
public PushDecryptJob(Context context, long messageId) {
|
public PushDecryptJob(Context context, long messageId, String sender) {
|
||||||
super(context, JobParameters.newBuilder()
|
super(context, JobParameters.newBuilder()
|
||||||
.withPersistence()
|
.withPersistence()
|
||||||
.withRequirement(new MasterSecretRequirement(context))
|
.withRequirement(new MasterSecretRequirement(context))
|
||||||
|
.withGroupId(sender)
|
||||||
.create());
|
.create());
|
||||||
this.messageId = messageId;
|
this.messageId = messageId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@ public class PushReceiveJob extends ContextJob {
|
||||||
envelope.getRelay()));
|
envelope.getRelay()));
|
||||||
}
|
}
|
||||||
|
|
||||||
jobManager.add(new PushDecryptJob(context, messageId));
|
jobManager.add(new PushDecryptJob(context, messageId, envelope.getSource()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleReceipt(TextSecureEnvelope envelope) {
|
private void handleReceipt(TextSecureEnvelope envelope) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue