mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Block avatar downloads in message request states.
This commit is contained in:
@@ -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? {
|
||||
|
||||
Reference in New Issue
Block a user