use of org.thoughtcrime.securesms.jobs.PushTextSendJob in project Signal-Android by WhisperSystems.
the class MessageSender method sendTextPush.
private static void sendTextPush(Context context, Recipients recipients, long messageId) {
JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
jobManager.add(new PushTextSendJob(context, messageId, recipients.getPrimaryRecipient().getNumber()));
}
use of org.thoughtcrime.securesms.jobs.PushTextSendJob in project Signal-Android by signalapp.
the class MessageSender method sendTextPush.
private static void sendTextPush(Context context, Recipient recipient, long messageId) {
JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
jobManager.add(new PushTextSendJob(context, messageId, recipient.getAddress()));
}
use of org.thoughtcrime.securesms.jobs.PushTextSendJob in project Signal-Android by WhisperSystems.
the class RecipientIdJobMigrationTest method migrate_pushTextSendJob.
@Test
public void migrate_pushTextSendJob() throws Exception {
JobData testData = new JobData("PushTextSendJob", "+16101234567", new Data.Builder().putLong("message_id", 1).build());
mockRecipientResolve("+16101234567", 1);
RecipientIdJobMigration subject = new RecipientIdJobMigration(mock(Application.class));
JobData converted = subject.migrate(testData);
assertEquals("PushTextSendJob", converted.getFactoryKey());
assertEquals(RecipientId.from(1).toQueueKey(), converted.getQueueKey());
assertEquals(1, converted.getData().getLong("message_id"));
new PushTextSendJob.Factory().create(mock(Job.Parameters.class), converted.getData());
}
Aggregations