support Pleroma upload_limit configuration (#2646)

* support Pleroma upload_limit configuration

* fix ComposeActivityTest
This commit is contained in:
Konrad Pozniak 2022-08-07 19:14:42 +02:00 committed by GitHub
parent 68c9870b19
commit 17cfa3d9b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -70,8 +70,8 @@ class InstanceInfoRepository @Inject constructor(
maxPollDuration = instance.configuration?.polls?.maxExpiration ?: instance.pollConfiguration?.maxExpiration,
charactersReservedPerUrl = instance.configuration?.statuses?.charactersReservedPerUrl,
version = instance.version,
videoSizeLimit = instance.configuration?.mediaAttachments?.videoSizeLimit,
imageSizeLimit = instance.configuration?.mediaAttachments?.imageSizeLimit,
videoSizeLimit = instance.configuration?.mediaAttachments?.videoSizeLimit ?: instance.uploadLimit,
imageSizeLimit = instance.configuration?.mediaAttachments?.imageSizeLimit ?: instance.uploadLimit,
imageMatrixLimit = instance.configuration?.mediaAttachments?.imageMatrixLimit,
maxMediaAttachments = instance.configuration?.statuses?.maxMediaAttachments ?: instance.maxMediaAttachments,
maxFields = instance.pleroma?.metadata?.fieldLimits?.maxFields,

View File

@ -32,7 +32,8 @@ data class Instance(
@SerializedName("poll_limits") val pollConfiguration: PollConfiguration?,
val configuration: InstanceConfiguration?,
@SerializedName("max_media_attachments") val maxMediaAttachments: Int?,
val pleroma: PleromaConfiguration?
val pleroma: PleromaConfiguration?,
@SerializedName("upload_limit") val uploadLimit: Int?
) {
override fun hashCode(): Int {
return uri.hashCode()

View File

@ -465,7 +465,8 @@ class ComposeActivityTest {
pollConfiguration = null,
configuration = configuration,
maxMediaAttachments = null,
pleroma = null
pleroma = null,
uploadLimit = null
)
}