mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 02:10:44 +01:00
Allow hidden story viewing.
This commit is contained in:
@@ -190,7 +190,7 @@ public abstract class MessageDatabase extends Database implements MmsSmsColumns
|
||||
public abstract @NonNull Reader getAllStoriesFor(@NonNull RecipientId recipientId);
|
||||
public abstract @NonNull MessageId getStoryId(@NonNull RecipientId authorId, long sentTimestamp) throws NoSuchMessageException;
|
||||
public abstract int getNumberOfStoryReplies(long parentStoryId);
|
||||
public abstract long getUnreadStoryThreadCount();
|
||||
public abstract @NonNull List<RecipientId> getUnreadStoryThreadRecipientIds();
|
||||
public abstract boolean containsStories(long threadId);
|
||||
public abstract boolean hasSelfReplyInStory(long parentStoryId);
|
||||
public abstract @NonNull Cursor getStoryReplies(long parentStoryId);
|
||||
|
||||
@@ -650,7 +650,7 @@ public class MmsDatabase extends MessageDatabase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getUnreadStoryThreadCount() {
|
||||
public @NonNull List<RecipientId> getUnreadStoryThreadRecipientIds() {
|
||||
SQLiteDatabase db = getReadableDatabase();
|
||||
String query = "SELECT DISTINCT " + ThreadDatabase.RECIPIENT_ID + "\n"
|
||||
+ "FROM " + TABLE_NAME + "\n"
|
||||
@@ -660,11 +660,16 @@ public class MmsDatabase extends MessageDatabase {
|
||||
|
||||
try (Cursor cursor = db.rawQuery(query, null)) {
|
||||
if (cursor != null) {
|
||||
return cursor.getCount();
|
||||
List<RecipientId> recipientIds = new ArrayList<>(cursor.getCount());
|
||||
while (cursor.moveToNext()) {
|
||||
recipientIds.add(RecipientId.from(cursor.getLong(0)));
|
||||
}
|
||||
|
||||
return recipientIds;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1427,7 +1427,7 @@ public class SmsDatabase extends MessageDatabase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getUnreadStoryThreadCount() {
|
||||
public @NonNull List<RecipientId> getUnreadStoryThreadRecipientIds() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user