use @JvmStatic instead of Companion reference, code style
This commit is contained in:
parent
825f06b1f3
commit
4c295e2f1b
3 changed files with 15 additions and 12 deletions
|
@ -44,6 +44,7 @@ data class AutocryptDraftStateHeader(val isEncrypt: Boolean,
|
||||||
|
|
||||||
const val VALUE_YES = "yes";
|
const val VALUE_YES = "yes";
|
||||||
|
|
||||||
|
@JvmStatic
|
||||||
fun fromCryptoStatus(cryptoStatus: CryptoStatus): AutocryptDraftStateHeader {
|
fun fromCryptoStatus(cryptoStatus: CryptoStatus): AutocryptDraftStateHeader {
|
||||||
if (cryptoStatus.isSignOnly) {
|
if (cryptoStatus.isSignOnly) {
|
||||||
return AutocryptDraftStateHeader(false, true, cryptoStatus.isReplyToEncrypted,
|
return AutocryptDraftStateHeader(false, true, cryptoStatus.isReplyToEncrypted,
|
||||||
|
|
|
@ -129,7 +129,7 @@ public class PgpMessageBuilder extends MessageBuilder {
|
||||||
|
|
||||||
private void addDraftStateHeader() {
|
private void addDraftStateHeader() {
|
||||||
AutocryptDraftStateHeader autocryptDraftStateHeader =
|
AutocryptDraftStateHeader autocryptDraftStateHeader =
|
||||||
AutocryptDraftStateHeader.Companion.fromCryptoStatus(cryptoStatus);
|
AutocryptDraftStateHeader.fromCryptoStatus(cryptoStatus);
|
||||||
currentProcessedMimeMessage.setHeader(AutocryptDraftStateHeader.AUTOCRYPT_DRAFT_STATE_HEADER,
|
currentProcessedMimeMessage.setHeader(AutocryptDraftStateHeader.AUTOCRYPT_DRAFT_STATE_HEADER,
|
||||||
autocryptDraftStateHeader.toHeaderValue());
|
autocryptDraftStateHeader.toHeaderValue());
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,8 @@ import org.openintents.openpgp.OpenPgpApiManager.OpenPgpProviderState
|
||||||
* during email composition to apply cryptographic operations before sending
|
* during email composition to apply cryptographic operations before sending
|
||||||
* or saving as draft.
|
* or saving as draft.
|
||||||
*/
|
*/
|
||||||
data class ComposeCryptoStatus(private val openPgpProviderState: OpenPgpProviderState,
|
data class ComposeCryptoStatus(
|
||||||
|
private val openPgpProviderState: OpenPgpProviderState,
|
||||||
override val openPgpKeyId: Long?,
|
override val openPgpKeyId: Long?,
|
||||||
val recipientAddresses: List<String>,
|
val recipientAddresses: List<String>,
|
||||||
override val isPgpInlineModeEnabled: Boolean,
|
override val isPgpInlineModeEnabled: Boolean,
|
||||||
|
@ -24,7 +25,8 @@ data class ComposeCryptoStatus(private val openPgpProviderState: OpenPgpProvider
|
||||||
override val isEncryptAllDrafts: Boolean,
|
override val isEncryptAllDrafts: Boolean,
|
||||||
override val isEncryptSubject: Boolean,
|
override val isEncryptSubject: Boolean,
|
||||||
private val cryptoMode: CryptoMode,
|
private val cryptoMode: CryptoMode,
|
||||||
private val recipientAutocryptStatus: RecipientAutocryptStatus? = null) : CryptoStatus {
|
private val recipientAutocryptStatus: RecipientAutocryptStatus? = null
|
||||||
|
) : CryptoStatus {
|
||||||
|
|
||||||
constructor(openPgpProviderState: OpenPgpProviderState,
|
constructor(openPgpProviderState: OpenPgpProviderState,
|
||||||
openPgpKeyId: Long?,
|
openPgpKeyId: Long?,
|
||||||
|
@ -143,7 +145,7 @@ data class ComposeCryptoStatus(private val openPgpProviderState: OpenPgpProvider
|
||||||
isPgpInlineModeEnabled = isPgpInlineModeEnabled,
|
isPgpInlineModeEnabled = isPgpInlineModeEnabled,
|
||||||
isSenderPreferEncryptMutual = isSenderPreferEncryptMutual,
|
isSenderPreferEncryptMutual = isSenderPreferEncryptMutual,
|
||||||
isReplyToEncrypted = isReplyToEncrypted,
|
isReplyToEncrypted = isReplyToEncrypted,
|
||||||
isEncryptAllDrafts= isEncryptAllDrafts,
|
isEncryptAllDrafts = isEncryptAllDrafts,
|
||||||
isEncryptSubject = isEncryptSubject,
|
isEncryptSubject = isEncryptSubject,
|
||||||
recipientAddresses = recipientAddresses,
|
recipientAddresses = recipientAddresses,
|
||||||
recipientAutocryptStatus = recipientAutocryptStatusType
|
recipientAutocryptStatus = recipientAutocryptStatusType
|
||||||
|
|
Loading…
Reference in a new issue