mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 10:20:25 +01:00
Make attachment count/size remote configurable.
This commit is contained in:
committed by
Nicholas Tinsley
parent
938c82be3f
commit
4d6d31d624
@@ -10,6 +10,7 @@ import org.thoughtcrime.securesms.attachments.PointerAttachment
|
||||
import org.thoughtcrime.securesms.database.model.StoryType
|
||||
import org.thoughtcrime.securesms.groups.GroupId
|
||||
import org.thoughtcrime.securesms.stickers.StickerLocator
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags
|
||||
import org.thoughtcrime.securesms.util.MediaUtil
|
||||
import org.whispersystems.signalservice.api.InvalidMessageStructureException
|
||||
import org.whispersystems.signalservice.api.crypto.EnvelopeMetadata
|
||||
@@ -31,8 +32,6 @@ private val ByteString.isNotEmpty: Boolean
|
||||
|
||||
object SignalServiceProtoUtil {
|
||||
|
||||
const val MAX_ALLOWED_ATTACHMENTS = 100
|
||||
|
||||
/** Contains some user data that affects the conversation */
|
||||
val DataMessage.hasRenderableContent: Boolean
|
||||
get() {
|
||||
@@ -161,7 +160,7 @@ object SignalServiceProtoUtil {
|
||||
}
|
||||
|
||||
fun List<AttachmentPointer>.toPointersWithinLimit(): List<Attachment> {
|
||||
return mapNotNull { it.toPointer() }.take(MAX_ALLOWED_ATTACHMENTS)
|
||||
return mapNotNull { it.toPointer() }.take(FeatureFlags.maxAttachmentCount())
|
||||
}
|
||||
|
||||
fun AttachmentPointer.toPointer(stickerLocator: StickerLocator? = null): Attachment? {
|
||||
|
||||
Reference in New Issue
Block a user