Fix max-line-length issues manually as auto format does fail

This commit is contained in:
Wolf-Martell Montwé 2023-11-06 17:44:31 +01:00
parent 9c09a33c7c
commit 7565bb8e66
No known key found for this signature in database
GPG key ID: 6D45B21512ACBF72
8 changed files with 38 additions and 16 deletions

View file

@ -46,7 +46,10 @@ class GenericUriParserTest {
assertUriValid("xmpp:example-node@example.com?message")
assertUriValid("xmpp:example-node@example.com?message;subject=Hello%20World")
assertUriValid("xmpp:nasty!%23\$%25()*+,-.;=%3F%5B%5C%5D%5E_%60%7B%7C%7D~node@example.com")
assertUriValid("xmpp:node@example.com/repulsive%20!%23%22\$%25&'()*+,-.%2F:;%3C=%3E%3F%40%5B%5C%5D%5E_%60%7B%7C%7D~resource")
assertUriValid(
"xmpp:node@example.com/repulsive" +
"%20!%23%22\$%25&'()*+,-.%2F:;%3C=%3E%3F%40%5B%5C%5D%5E_%60%7B%7C%7D~resource",
)
assertUriValid("xmpp:ji%C5%99i@%C4%8Dechy.example/v%20Praze")
}

View file

@ -79,7 +79,13 @@ internal class MigrationTo70(private val db: SQLiteDatabase) {
private fun recreateFoldersTriggers() {
db.execSQL("DROP TRIGGER IF EXISTS delete_folder")
db.execSQL("CREATE TRIGGER delete_folder BEFORE DELETE ON folders BEGIN DELETE FROM messages WHERE old.id = folder_id; END;")
db.execSQL(
"CREATE TRIGGER delete_folder " +
"BEFORE DELETE ON folders " +
"BEGIN " +
"DELETE FROM messages WHERE old.id = folder_id; " +
"END;",
)
db.execSQL("DROP TRIGGER IF EXISTS delete_folder_extra_values")
db.execSQL(

View file

@ -13,7 +13,8 @@ internal class MigrationTo84(private val db: SQLiteDatabase) {
fun rewriteAddresses() {
val addressSets = db.rawQuery(
"SELECT id, to_list, cc_list, bcc_list, reply_to_list, sender_list FROM messages WHERE empty = 0 AND deleted = 0",
"SELECT id, to_list, cc_list, bcc_list, reply_to_list, sender_list " +
"FROM messages WHERE empty = 0 AND deleted = 0",
null,
).use { cursor ->
cursor.map {

View file

@ -7,7 +7,6 @@ import com.fsck.k9.message.AutocryptStatusInteractor
import com.fsck.k9.message.AutocryptStatusInteractor.RecipientAutocryptStatus
import com.fsck.k9.message.CryptoStatus
import com.fsck.k9.view.RecipientSelectView.Recipient
import org.openintents.openpgp.OpenPgpApiManager
import org.openintents.openpgp.OpenPgpApiManager.OpenPgpProviderState
/** This is an immutable object which contains all relevant metadata entered
@ -76,10 +75,10 @@ data class ComposeCryptoStatus(
val recipientAddressesAsArray = recipientAddresses.toTypedArray()
private val displayTypeFromProviderError = when (openPgpProviderState) {
OpenPgpApiManager.OpenPgpProviderState.OK -> null
OpenPgpApiManager.OpenPgpProviderState.UNCONFIGURED -> CryptoStatusDisplayType.UNCONFIGURED
OpenPgpApiManager.OpenPgpProviderState.UNINITIALIZED -> CryptoStatusDisplayType.UNINITIALIZED
OpenPgpApiManager.OpenPgpProviderState.ERROR, OpenPgpApiManager.OpenPgpProviderState.UI_REQUIRED -> CryptoStatusDisplayType.ERROR
OpenPgpProviderState.OK -> null
OpenPgpProviderState.UNCONFIGURED -> CryptoStatusDisplayType.UNCONFIGURED
OpenPgpProviderState.UNINITIALIZED -> CryptoStatusDisplayType.UNINITIALIZED
OpenPgpProviderState.ERROR, OpenPgpProviderState.UI_REQUIRED -> CryptoStatusDisplayType.ERROR
}
private val displayTypeFromAutocryptError = when (recipientAutocryptStatusType) {

View file

@ -94,7 +94,11 @@ class JmapBackend(
return messageServerIds.associateWith { it }
}
override fun moveMessagesAndMarkAsRead(sourceFolderServerId: String, targetFolderServerId: String, messageServerIds: List<String>): Map<String, String>? {
override fun moveMessagesAndMarkAsRead(
sourceFolderServerId: String,
targetFolderServerId: String,
messageServerIds: List<String>,
): Map<String, String>? {
commandMove.moveMessagesAndMarkAsRead(targetFolderServerId, messageServerIds)
return messageServerIds.associateWith { it }
}

View file

@ -135,7 +135,9 @@ inline fun <reified STATE, EVENT, EFFECT> UnidirectionalViewModel<STATE, EVENT,
*/
@Suppress("MaxLineLength")
@Composable
inline fun <reified STATE, EVENT, EFFECT> UnidirectionalViewModel<STATE, EVENT, EFFECT>.observeWithoutEffect(): StateDispatch<STATE, EVENT> {
inline fun <reified STATE, EVENT, EFFECT> UnidirectionalViewModel<STATE, EVENT, EFFECT>.observeWithoutEffect(
// no effect handler
): StateDispatch<STATE, EVENT> {
val collectedState = state.collectAsStateWithLifecycle()
val dispatch: (EVENT) -> Unit = { event(it) }

View file

@ -19,9 +19,10 @@ class BoundaryGeneratorTest {
@Test
fun generateBoundary() {
val random = createRandom(
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 35,
)
val seed = IntRange(0, 28).toList().toIntArray()
val random = createRandom(*seed, 35)
val boundaryGenerator = BoundaryGenerator(random)
val result = boundaryGenerator.generateBoundary()

View file

@ -970,9 +970,12 @@ internal class RealImapFolder(
val encodeFolderName = folderNameCodec.encode(prefixedName)
val escapedFolderName = ImapUtility.encodeString(encodeFolderName)
val canCreateForwardedFlag = canCreateKeywords ||
internalImapStore.getPermanentFlagsIndex().contains(Flag.FORWARDED)
val combinedFlags = ImapUtility.combineFlags(
message.flags,
canCreateKeywords || internalImapStore.getPermanentFlagsIndex().contains(Flag.FORWARDED),
canCreateForwardedFlag,
)
val command = String.format(
Locale.US,
@ -1101,7 +1104,9 @@ internal class RealImapFolder(
open(OpenMode.READ_WRITE)
checkOpen()
val canCreateForwardedFlag = canCreateKeywords || internalImapStore.getPermanentFlagsIndex().contains(Flag.FORWARDED)
val canCreateForwardedFlag = canCreateKeywords ||
internalImapStore.getPermanentFlagsIndex().contains(Flag.FORWARDED)
try {
val combinedFlags = ImapUtility.combineFlags(flags, canCreateForwardedFlag)
val command = String.format(
@ -1123,7 +1128,8 @@ internal class RealImapFolder(
checkOpen()
val uids = messages.map { it.uid.toLong() }.toSet()
val canCreateForwardedFlag = canCreateKeywords || internalImapStore.getPermanentFlagsIndex().contains(Flag.FORWARDED)
val canCreateForwardedFlag = canCreateKeywords ||
internalImapStore.getPermanentFlagsIndex().contains(Flag.FORWARDED)
val combinedFlags = ImapUtility.combineFlags(flags, canCreateForwardedFlag)
val commandSuffix = String.format("%sFLAGS.SILENT (%s)", if (value) "+" else "-", combinedFlags)
try {