Fix several issues with chatcolors.

This commit is contained in:
Alex Hart
2021-05-27 14:39:14 -03:00
committed by Cody Henthorne
parent e5b0941d30
commit 18133e2a10
10 changed files with 44 additions and 14 deletions

View File

@@ -1411,11 +1411,11 @@ public class RecipientDatabase extends Database {
}
}
public int getColorUsageCount(@NotNull ChatColors chatColors) {
public int getColorUsageCount(@NotNull ChatColors.Id chatColorsId) {
SQLiteDatabase db = databaseHelper.getReadableDatabase();
String[] projection = SqlUtil.buildArgs("COUNT(*)");
String where = CUSTOM_CHAT_COLORS_ID + " = ?";
String[] args = SqlUtil.buildArgs(chatColors.getId().getLongValue());
String[] args = SqlUtil.buildArgs(chatColorsId.getLongValue());
try (Cursor cursor = db.query(TABLE_NAME, projection, where, args, null, null, null)) {
if (cursor == null) {