Implement username is out of sync banner.

This commit is contained in:
Alex Hart
2023-02-17 09:27:31 -04:00
committed by Greyson Parrelli
parent 4954be109c
commit a398745740
9 changed files with 302 additions and 3 deletions

View File

@@ -2085,6 +2085,16 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
}
}
fun getUsername(id: RecipientId): String? {
return writableDatabase.query(TABLE_NAME, arrayOf(USERNAME), "$ID = ?", SqlUtil.buildArgs(id), null, null, null).use {
if (it.moveToFirst()) {
it.requireString(USERNAME)
} else {
null
}
}
}
fun setUsername(id: RecipientId, username: String?) {
writableDatabase.withinTransaction {
if (username != null) {