Restore group profile pictures after restore.

This commit is contained in:
Michelle Tang
2025-01-22 13:40:26 -05:00
committed by GitHub
parent f1782d06a4
commit 2f381863ed
2 changed files with 20 additions and 8 deletions

View File

@@ -78,7 +78,9 @@ import java.util.stream.Collectors
import javax.annotation.CheckReturnValue
import kotlin.math.abs
class GroupTable(context: Context?, databaseHelper: SignalDatabase?) : DatabaseTable(context, databaseHelper), RecipientIdDatabaseReference {
class GroupTable(context: Context?, databaseHelper: SignalDatabase?) :
DatabaseTable(context, databaseHelper),
RecipientIdDatabaseReference {
companion object {
private val TAG = Log.tag(GroupTable::class.java)
@@ -1097,7 +1099,9 @@ class GroupTable(context: Context?, databaseHelper: SignalDatabase?) : DatabaseT
}
}
class Reader(val cursor: Cursor?) : Closeable, ContactSearchIterator<GroupRecord> {
class Reader(val cursor: Cursor?) :
Closeable,
ContactSearchIterator<GroupRecord> {
fun getNext(): GroupRecord? {
return if (cursor == null || !cursor.moveToNext()) {
@@ -1163,6 +1167,10 @@ class GroupTable(context: Context?, databaseHelper: SignalDatabase?) : DatabaseT
DecryptedGroupUtil.bannedMembersToServiceIdSet(decryptedGroup.bannedMembers)
}
val avatarKey: String by lazy {
decryptedGroup.avatar
}
fun isAdmin(recipient: Recipient): Boolean {
val aci = recipient.aci