mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 08:39:22 +01:00
Rotate profile key when contact hidden.
This commit is contained in:
@@ -1806,11 +1806,19 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
|
||||
}
|
||||
}
|
||||
|
||||
fun markHidden(id: RecipientId) {
|
||||
val contentValues = contentValuesOf(
|
||||
HIDDEN to 1,
|
||||
PROFILE_SHARING to 0
|
||||
)
|
||||
fun markHidden(id: RecipientId, clearProfileKey: Boolean = false) {
|
||||
val contentValues = if (clearProfileKey) {
|
||||
contentValuesOf(
|
||||
HIDDEN to 1,
|
||||
PROFILE_SHARING to 0,
|
||||
PROFILE_KEY to null
|
||||
)
|
||||
} else {
|
||||
contentValuesOf(
|
||||
HIDDEN to 1,
|
||||
PROFILE_SHARING to 0
|
||||
)
|
||||
}
|
||||
|
||||
val updated = writableDatabase.update(TABLE_NAME, contentValues, "$ID_WHERE AND $GROUP_TYPE = ?", SqlUtil.buildArgs(id, GroupType.NONE.id)) > 0
|
||||
if (updated) {
|
||||
|
||||
Reference in New Issue
Block a user