diff --git a/app/src/main/java/com/keylesspalace/tusky/components/instanceinfo/InstanceInfoRepository.kt b/app/src/main/java/com/keylesspalace/tusky/components/instanceinfo/InstanceInfoRepository.kt index 7415dd06..170cff2b 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/instanceinfo/InstanceInfoRepository.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/instanceinfo/InstanceInfoRepository.kt @@ -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, diff --git a/app/src/main/java/com/keylesspalace/tusky/entity/Instance.kt b/app/src/main/java/com/keylesspalace/tusky/entity/Instance.kt index eccc8696..5cd921b8 100644 --- a/app/src/main/java/com/keylesspalace/tusky/entity/Instance.kt +++ b/app/src/main/java/com/keylesspalace/tusky/entity/Instance.kt @@ -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() diff --git a/app/src/test/java/com/keylesspalace/tusky/ComposeActivityTest.kt b/app/src/test/java/com/keylesspalace/tusky/ComposeActivityTest.kt index 8dd92162..2c20cb78 100644 --- a/app/src/test/java/com/keylesspalace/tusky/ComposeActivityTest.kt +++ b/app/src/test/java/com/keylesspalace/tusky/ComposeActivityTest.kt @@ -465,7 +465,8 @@ class ComposeActivityTest { pollConfiguration = null, configuration = configuration, maxMediaAttachments = null, - pleroma = null + pleroma = null, + uploadLimit = null ) }