Improve 'mark all read' performance.

master
Greyson Parrelli 2020-06-24 07:34:52 -07:00 committed by GitHub
parent cd3df4d3c1
commit 4ea861fe5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -153,13 +153,15 @@ public abstract class MessagingDatabase extends Database implements MmsSmsColumn
}
public void setAllReactionsSeen() {
SQLiteDatabase db = databaseHelper.getWritableDatabase();
ContentValues values = new ContentValues();
SQLiteDatabase db = databaseHelper.getWritableDatabase();
ContentValues values = new ContentValues();
String query = REACTIONS_UNREAD + " != ?";
String[] args = new String[] { "0" };
values.put(REACTIONS_UNREAD, 0);
values.put(REACTIONS_LAST_SEEN, System.currentTimeMillis());
db.update(getTableName(), values, null, null);
db.update(getTableName(), values, query, args);
}
public void addReaction(long messageId, @NonNull ReactionRecord reaction) {