mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-09-20 00:35:47 +01:00
Remove notification channel upon group deletion.
This commit is contained in:
committed by
Cody Henthorne
parent
1e5b7868fd
commit
e84b43ab06
@@ -4614,6 +4614,19 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
|
||||
* Blanks out every column for a group's recipient row except [ID], [GROUP_ID], [TYPE], [BLOCKED], [BLOCKED_AT], and [STORAGE_SERVICE_ID].
|
||||
*/
|
||||
fun clearGroupRecipient(recipientId: RecipientId, keepIdentifier: Boolean): Boolean {
|
||||
readableDatabase
|
||||
.select(NOTIFICATION_CHANNEL)
|
||||
.from(TABLE_NAME)
|
||||
.where("$ID = ? AND $NOTIFICATION_CHANNEL IS NOT NULL", recipientId)
|
||||
.run()
|
||||
.use { cursor ->
|
||||
if (cursor.moveToFirst()) {
|
||||
NotificationChannels.getInstance().deleteChannel(cursor.requireString(NOTIFICATION_CHANNEL))
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
val cleared = if (keepIdentifier) {
|
||||
writableDatabase
|
||||
.update(TABLE_NAME)
|
||||
|
||||
Reference in New Issue
Block a user