Change ImapSettings.useCompression
to a property
This commit is contained in:
parent
2b0a8469b8
commit
89d3df091f
4 changed files with 5 additions and 7 deletions
|
@ -14,7 +14,7 @@ internal interface ImapSettings {
|
|||
val username: String
|
||||
val password: String?
|
||||
val clientCertificateAlias: String?
|
||||
fun useCompression(): Boolean
|
||||
val useCompression: Boolean
|
||||
|
||||
var pathPrefix: String?
|
||||
var pathDelimiter: String?
|
||||
|
|
|
@ -549,7 +549,7 @@ internal class RealImapConnection(
|
|||
}
|
||||
|
||||
private fun enableCompressionIfRequested() {
|
||||
if (hasCapability(Capabilities.COMPRESS_DEFLATE) && settings.useCompression()) {
|
||||
if (hasCapability(Capabilities.COMPRESS_DEFLATE) && settings.useCompression) {
|
||||
enableCompression()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -296,9 +296,8 @@ internal open class RealImapStore(
|
|||
override val password: String? = serverSettings.password
|
||||
override val clientCertificateAlias: String? = serverSettings.clientCertificateAlias
|
||||
|
||||
override fun useCompression(): Boolean {
|
||||
return this@RealImapStore.config.useCompression()
|
||||
}
|
||||
override val useCompression: Boolean
|
||||
get() = this@RealImapStore.config.useCompression()
|
||||
|
||||
override var pathPrefix: String?
|
||||
get() = this@RealImapStore.pathPrefix
|
||||
|
|
|
@ -10,10 +10,9 @@ internal class SimpleImapSettings(
|
|||
override val authType: AuthType,
|
||||
override val username: String,
|
||||
override val password: String? = null,
|
||||
private val useCompression: Boolean = false
|
||||
override val useCompression: Boolean = false
|
||||
) : ImapSettings {
|
||||
override val clientCertificateAlias: String? = null
|
||||
override fun useCompression(): Boolean = useCompression
|
||||
|
||||
override var pathPrefix: String? = null
|
||||
override var pathDelimiter: String? = null
|
||||
|
|
Loading…
Reference in a new issue