Skip to content

Commit

Permalink
Improve 'mark all read' performance.
Browse files Browse the repository at this point in the history
  • Loading branch information
greyson-signal committed Jun 24, 2020
1 parent cd3df4d commit 4ea861f
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -153,13 +153,15 @@ public void setReactionsSeen(long threadId) {
}

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) {
Expand Down

0 comments on commit 4ea861f

Please sign in to comment.