mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Use alarm clock for scheduling message sends.
This commit is contained in:
committed by
Greyson Parrelli
parent
56b35f3767
commit
3a0dbe6e67
@@ -4648,16 +4648,20 @@ public class MessageTable extends DatabaseTable implements MessageTypes, Recipie
|
||||
}
|
||||
}
|
||||
|
||||
public @Nullable Long getOldestScheduledSendTimestamp() {
|
||||
public @Nullable MessageRecord getOldestScheduledSendTimestamp() {
|
||||
String[] columns = new String[] { SCHEDULED_DATE };
|
||||
String selection = STORY_TYPE + " = ? AND " + PARENT_STORY_ID + " <= ? AND " + SCHEDULED_DATE + " != ?";
|
||||
String[] args = SqlUtil.buildArgs(0, 0, -1);
|
||||
String order = SCHEDULED_DATE + " ASC, " + ID + " ASC";
|
||||
String limit = "1";
|
||||
|
||||
try (Cursor cursor = getReadableDatabase().query(TABLE_NAME, columns, selection, args, null, null, order, limit)) {
|
||||
return cursor != null && cursor.moveToNext() ? cursor.getLong(0) : null;
|
||||
try (MmsReader reader = mmsReaderFor(getReadableDatabase().query(TABLE_NAME, MMS_PROJECTION, selection, args, null, null, order, limit))) {
|
||||
if (reader.getNext() != null) {
|
||||
return reader.getCurrent();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public Cursor getMessagesForNotificationState(Collection<DefaultMessageNotifier.StickyThread> stickyThreads) {
|
||||
|
||||
Reference in New Issue
Block a user