Skip to content
Snippets Groups Projects
Verified Commit 781fad77 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Further cleanup and tests

parent 075c4c06
No related branches found
No related tags found
1 merge request!2Draft: Jetpack compose rewrite
Pipeline #578 failed
Showing
with 189 additions and 98 deletions
package de.kuschku.quasseldroid
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
......
......@@ -19,17 +19,13 @@ import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.lifecycleScope
import dagger.hilt.android.AndroidEntryPoint
import de.kuschku.quasseldroid.ui.theme.QuasseldroidTheme
import de.kuschku.quasseldroid.ui.theme.shapes
import de.kuschku.quasseldroid.ui.theme.typography
import dev.chrisbanes.accompanist.coil.CoilImage
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.flow
import org.threeten.bp.ZonedDateTime
import org.threeten.bp.format.DateTimeFormatter
import kotlin.random.Random
......
package de.kuschku.quasseldroid
import de.kuschku.bitflags.of
import de.kuschku.libquassel.protocol.connection.ProtocolInfoSerializer
import de.kuschku.libquassel.protocol.features.FeatureSet
import de.kuschku.libquassel.protocol.features.LegacyFeature
import de.kuschku.libquassel.protocol.features.QuasselFeature
import de.kuschku.libquassel.protocol.io.ChainedByteBuffer
import de.kuschku.libquassel.protocol.messages.handshake.ClientInit
import de.kuschku.libquassel.protocol.serializers.handshake.ClientInitAckSerializer
import de.kuschku.libquassel.protocol.serializers.handshake.ClientInitRejectSerializer
import de.kuschku.libquassel.protocol.serializers.handshake.ClientInitSerializer
import de.kuschku.libquassel.protocol.serializers.handshake.HandshakeMapSerializer
import de.kuschku.libquassel.protocol.serializers.primitive.HandshakeMapSerializer
import de.kuschku.libquassel.protocol.serializers.primitive.IntSerializer
import de.kuschku.libquassel.protocol.serializers.primitive.UIntSerializer
import de.kuschku.libquassel.protocol.variant.into
......
......@@ -17,8 +17,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension
import org.jetbrains.kotlin.gradle.plugin.KaptExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
......
......@@ -21,7 +21,6 @@ package de.kuschku.justcode
import java.io.IOException
import java.io.OutputStream
import java.util.*
class NullOutputStream : OutputStream() {
@Volatile
......
......@@ -22,7 +22,6 @@ package de.kuschku.libquassel.protocol.features
import de.kuschku.bitflags.Flag
import de.kuschku.bitflags.Flags
import de.kuschku.bitflags.toEnumSet
import java.util.*
/**
* A list of features that are optional in core and/or client, but need runtime checking
......@@ -42,25 +41,35 @@ enum class LegacyFeature(
SaslExternal(0x0004u, QuasselFeature.SaslExternal),
HideInactiveNetworks(0x0008u, QuasselFeature.HideInactiveNetworks),
PasswordChange(0x0010u, QuasselFeature.PasswordChange),
/** IRCv3 capability negotiation, account tracking */
CapNegotiation(0x0020u, QuasselFeature.CapNegotiation),
/** IRC server SSL validation */
VerifyServerSSL(0x0040u, QuasselFeature.VerifyServerSSL),
/** IRC server custom message rate limits */
CustomRateLimits(0x0080u, QuasselFeature.CustomRateLimits),
DccFileTransfer(0x0100u, QuasselFeature.DccFileTransfer),
/** Timestamp formatting in away (e.g. %%hh:mm%%) */
AwayFormatTimestamp(0x0200u, QuasselFeature.AwayFormatTimestamp),
/** Whether or not the core supports auth backends. */
Authenticators(0x0400u, QuasselFeature.Authenticators),
/** Sync buffer activity status */
BufferActivitySync(0x0800u, QuasselFeature.BufferActivitySync),
/** Core-Side highlight configuration and matching */
CoreSideHighlights(0x1000u, QuasselFeature.CoreSideHighlights),
/** Show prefixes for senders in backlog */
SenderPrefixes(0x2000u, QuasselFeature.SenderPrefixes),
/** Supports RPC call disconnectFromCore to remotely disconnect a client */
RemoteDisconnect(0x4000u, QuasselFeature.RemoteDisconnect),
/** Transmit features as list of strings */
ExtendedFeatures(0x8000u, QuasselFeature.ExtendedFeatures);
......
......@@ -29,38 +29,55 @@ enum class QuasselFeature {
SaslExternal,
HideInactiveNetworks,
PasswordChange,
/** IRCv3 capability negotiation, account tracking */
CapNegotiation,
/** IRC server SSL validation */
VerifyServerSSL,
/** IRC server custom message rate limits */
CustomRateLimits,
// Currently not supported
DccFileTransfer,
/** Timestamp formatting in away (e.g. %%hh:mm%%) */
AwayFormatTimestamp,
/** Whether or not the core supports auth backends. */
Authenticators,
/** Sync buffer activity status */
BufferActivitySync,
/** Core-Side highlight configuration and matching */
CoreSideHighlights,
/** Show prefixes for senders in backlog */
SenderPrefixes,
/** Supports RPC call disconnectFromCore to remotely disconnect a client */
RemoteDisconnect,
/** Transmit features as list of strings */
ExtendedFeatures,
/** Serialize message time as 64-bit */
LongTime,
/** Real Name and Avatar URL in backlog */
RichMessages,
/** Backlogmanager supports filtering backlog by messagetype */
BacklogFilterType,
/** ECDSA keys for CertFP in identities */
EcdsaCertfpKeys,
/** 64-bit IDs for messages */
LongMessageId,
/** CoreInfo dynamically updated using signals */
SyncedCoreInfo;
......@@ -68,6 +85,7 @@ enum class QuasselFeature {
companion object {
private val values = values().associateBy(QuasselFeature::feature)
@JvmStatic
fun valueOf(name: QuasselFeatureName): QuasselFeature? = values[name]
}
......
......@@ -22,3 +22,4 @@ package de.kuschku.libquassel.protocol.messages.handshake
data class ClientInitReject(
val errorString: String?
)
/*
* Quasseldroid - Quassel client for Android
*
* Copyright (c) 2021 Janne Mareike Koschinski
* Copyright (c) 2021 The Quassel Project
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3 as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.libquassel.protocol.messages.handshake
data class ClientLogin(
val user: String?,
val password: String?
)
/*
* Quasseldroid - Quassel client for Android
*
* Copyright (c) 2021 Janne Mareike Koschinski
* Copyright (c) 2021 The Quassel Project
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3 as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.libquassel.protocol.messages.handshake
object ClientLoginAck {
override fun toString(): String {
return "ClientLoginAck"
}
}
/*
* Quasseldroid - Quassel client for Android
*
* Copyright (c) 2021 Janne Mareike Koschinski
* Copyright (c) 2021 The Quassel Project
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3 as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.libquassel.protocol.messages.handshake
data class ClientLoginReject(
val errorString: String?
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment