Add default chat folders in backups.

This commit is contained in:
Michelle Tang
2024-10-23 11:41:01 -07:00
committed by Greyson Parrelli
parent 1ff6169795
commit 9a0ebb5028
2 changed files with 12 additions and 0 deletions

View File

@@ -395,6 +395,15 @@ class ChatFolderTables(context: Context?, databaseHelper: SignalDatabase?) : Dat
}
}
/**
* Inserts the default 'All chats' folder in cases where it could get deleted (eg backups)
*/
fun insertAllChatFolder() {
writableDatabase.withinTransaction { db ->
db.insert(ChatFolderTable.TABLE_NAME, null, getAllChatsFolderContentValues())
}
}
private fun Collection<Long>.toContentValues(chatFolderId: Long, membershipType: MembershipType): List<ContentValues> {
return map {
contentValuesOf(