Allow user to launch directly to a specific story, fix story chronology.

This commit is contained in:
Alex Hart
2022-03-16 14:22:11 -03:00
committed by Cody Henthorne
parent 8bb27b60fa
commit 63e48efdfe
13 changed files with 55 additions and 25 deletions

View File

@@ -183,7 +183,7 @@ public abstract class MessageDatabase extends Database implements MmsSmsColumns
public abstract boolean isStory(long messageId);
public abstract @NonNull Reader getOutgoingStoriesTo(@NonNull RecipientId recipientId);
public abstract @NonNull Reader getAllOutgoingStories();
public abstract @NonNull Reader getAllOutgoingStories(boolean reverse);
public abstract @NonNull Reader getAllStories();
public abstract @NonNull List<RecipientId> getAllStoriesRecipientsList();
public abstract @NonNull Reader getAllStoriesFor(@NonNull RecipientId recipientId);

View File

@@ -571,10 +571,10 @@ public class MmsDatabase extends MessageDatabase {
}
@Override
public @NonNull MessageDatabase.Reader getAllOutgoingStories() {
public @NonNull MessageDatabase.Reader getAllOutgoingStories(boolean reverse) {
String where = IS_STORY_CLAUSE + " AND (" + getOutgoingTypeClause() + ")";
return new Reader(rawQuery(where, null, true, -1L));
return new Reader(rawQuery(where, null, reverse, -1L));
}
@Override
@@ -587,7 +587,7 @@ public class MmsDatabase extends MessageDatabase {
long threadId = SignalDatabase.threads().getThreadIdIfExistsFor(recipientId);
String where = IS_STORY_CLAUSE + " AND " + THREAD_ID_WHERE;
String[] whereArgs = SqlUtil.buildArgs(threadId);
Cursor cursor = rawQuery(where, whereArgs, true, -1L);
Cursor cursor = rawQuery(where, whereArgs, false, -1L);
return new Reader(cursor);
}

View File

@@ -1395,7 +1395,7 @@ public class SmsDatabase extends MessageDatabase {
}
@Override
public @NonNull MessageDatabase.Reader getAllOutgoingStories() {
public @NonNull MessageDatabase.Reader getAllOutgoingStories(boolean reverse) {
throw new UnsupportedOperationException();
}