Sync deletion of profiles with storage service.

This commit is contained in:
Michelle Tang
2025-08-12 10:36:34 -04:00
parent 150e98bbc1
commit b1feffa627

View File

@@ -223,6 +223,8 @@ class NotificationProfileTables(context: Context, databaseHelper: SignalDatabase
put(NotificationProfileTable.ALLOW_ALL_MENTIONS, profile.allowAllMentions.toInt()) put(NotificationProfileTable.ALLOW_ALL_MENTIONS, profile.allowAllMentions.toInt())
put(NotificationProfileTable.STORAGE_SERVICE_ID, Base64.encodeWithPadding(storageServiceId)) put(NotificationProfileTable.STORAGE_SERVICE_ID, Base64.encodeWithPadding(storageServiceId))
put(NotificationProfileTable.STORAGE_SERVICE_PROTO, storageServiceProto) put(NotificationProfileTable.STORAGE_SERVICE_PROTO, storageServiceProto)
put(NotificationProfileTable.DELETED_TIMESTAMP_MS, profile.deletedTimestampMs)
put(NotificationProfileTable.CREATED_AT, profile.createdAt)
} }
val updateQuery = SqlUtil.buildTrueUpdateQuery(ID_WHERE, SqlUtil.buildArgs(profile.id), profileValues) val updateQuery = SqlUtil.buildTrueUpdateQuery(ID_WHERE, SqlUtil.buildArgs(profile.id), profileValues)
@@ -321,6 +323,7 @@ class NotificationProfileTables(context: Context, databaseHelper: SignalDatabase
.select() .select()
.from(NotificationProfileTable.TABLE_NAME) .from(NotificationProfileTable.TABLE_NAME)
.where("${NotificationProfileTable.DELETED_TIMESTAMP_MS} = 0") .where("${NotificationProfileTable.DELETED_TIMESTAMP_MS} = 0")
.orderBy("${NotificationProfileTable.CREATED_AT} DESC")
.run() .run()
.readToList { cursor -> getProfile(cursor) } .readToList { cursor -> getProfile(cursor) }
} }