Block avatar downloads in message request states.

This commit is contained in:
Michelle Tang
2025-03-06 12:36:58 -05:00
parent 5592d13258
commit 451d12ed53
28 changed files with 991 additions and 492 deletions

View File

@@ -1859,7 +1859,7 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
}
}
fun setProfileAvatar(id: RecipientId, profileAvatar: String?) {
fun setProfileAvatar(id: RecipientId, profileAvatar: String?, forceNotify: Boolean = false) {
val contentValues = ContentValues(1).apply {
put(PROFILE_AVATAR, profileAvatar)
}
@@ -1869,6 +1869,8 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
rotateStorageId(id)
StorageSyncHelper.scheduleSyncForDataChange()
}
} else if (forceNotify) {
AppDependencies.databaseObserver.notifyRecipientChanged(id)
}
}
@@ -3815,8 +3817,15 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
}
}
fun manuallyShowAvatar(recipientId: RecipientId) {
updateExtras(recipientId) { b: RecipientExtras.Builder -> b.manuallyShownAvatar(true) }
fun clearHasGroupsInCommon(recipientId: RecipientId) {
if (update(recipientId, contentValuesOf(GROUPS_IN_COMMON to 0))) {
Log.i(TAG, "Reset $recipientId to have no groups in common.")
Recipient.live(recipientId).refresh()
}
}
fun manuallyUpdateShowAvatar(recipientId: RecipientId, showAvatar: Boolean) {
updateExtras(recipientId) { b: RecipientExtras.Builder -> b.manuallyShownAvatar(showAvatar) }
}
fun getCapabilities(id: RecipientId): RecipientRecord.Capabilities? {