Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • justJanne/libquassel
1 result
Show changes
Showing
with 684 additions and 5 deletions
/*
* libquassel
* Copyright (c) 2024 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.api.server
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.RpcApi
import de.justjanne.libquassel.annotations.RpcParam
import de.justjanne.libquassel.annotations.RpcCall
import de.justjanne.libquassel.protocol.models.ids.BufferId
import de.justjanne.libquassel.protocol.models.ids.MsgId
@RpcApi("BacklogManager", side = ProtocolSide.CLIENT)
interface BacklogManagerServerApi {
/**
* Loads backlog for [bufferId], where the message id is >= [first] and < [last].
* If [first] or [last] is unset, the list will be unbounded in that direction.
*
* If a [limit] is set, the list will be truncated to the newest N messages.
*
* If both [first] and [last] are set, and the list of messages is not truncated by [limit],
* [additional] messages will be loaded before [last].
*/
@RpcCall("requestBacklog")
fun requestBacklog(
@RpcParam.UserType.BufferId bufferId: BufferId,
@RpcParam.UserType.MsgId first: MsgId = MsgId(-1),
@RpcParam.UserType.MsgId last: MsgId = MsgId(-1),
@RpcParam.Int limit: Int = -1,
@RpcParam.Int additional: Int = 0
)
/**
* Loads backlog for [bufferId], where the message id is >= [first] and < [last].
* If [first] or [last] is unset, the list will be unbounded in that direction.
*
* If a [limit] is set, the list will be truncated to the newest N messages.
*
* If both [first] and [last] are set, and the list of messages is not truncated by [limit],
* [additional] messages will be loaded before [last].
*
* Only messages matching [type] and [flags] will be returned and counted.
*/
@RpcCall("requestBacklogFiltered")
fun requestBacklogFiltered(
@RpcParam.UserType.BufferId bufferId: BufferId,
@RpcParam.UserType.MsgId first: MsgId = MsgId(-1),
@RpcParam.UserType.MsgId last: MsgId = MsgId(-1),
@RpcParam.Int limit: Int = -1,
@RpcParam.Int additional: Int = 0,
@RpcParam.Int type: Int = -1,
@RpcParam.Int flags: Int = -1
)
/**
* Loads backlog for [bufferId], where the message id is >= [first] and < [last].
* If [first] or [last] is unset, the list will be unbounded in that direction.
*
* If a [limit] is set, the list will be truncated to the oldest N messages.
*
* Only messages matching [type] and [flags] will be returned and counted.
*/
@RpcCall("requestBacklogForward")
fun requestBacklogForward(
@RpcParam.UserType.BufferId bufferId: BufferId,
@RpcParam.UserType.MsgId first: MsgId = MsgId(-1),
@RpcParam.UserType.MsgId last: MsgId = MsgId(-1),
@RpcParam.Int limit: Int = -1,
@RpcParam.Int type: Int = -1,
@RpcParam.Int flags: Int = -1
)
/**
* Loads backlog for all buffers, where the message id is >= [first] and < [last].
* If [first] or [last] is unset, the list will be unbounded in that direction.
*
* If a [limit] is set, the list will be truncated to the newest N messages.
*
* If both [first] and [last] are set, and the list of messages is not truncated by [limit],
* [additional] messages will be loaded before [last].
*/
@RpcCall("requestBacklogAll")
fun requestBacklogAll(
@RpcParam.UserType.MsgId first: MsgId = MsgId(-1),
@RpcParam.UserType.MsgId last: MsgId = MsgId(-1),
@RpcParam.Int limit: Int = -1,
@RpcParam.Int additional: Int = 0
)
/**
* Loads backlog for all buffers, where the message id is >= [first] and < [last].
* If [first] or [last] is unset, the list will be unbounded in that direction.
*
* If a [limit] is set, the list will be truncated to the newest N messages.
*
* If both [first] and [last] are set, and the list of messages is not truncated by [limit],
* [additional] messages will be loaded before [last].
*
* Only messages matching [type] and [flags] will be returned and counted.
*/
@RpcCall("requestBacklogAllFiltered")
fun requestBacklogAllFiltered(
@RpcParam.UserType.MsgId first: MsgId = MsgId(-1),
@RpcParam.UserType.MsgId last: MsgId = MsgId(-1),
@RpcParam.Int limit: Int = -1,
@RpcParam.Int additional: Int = 0,
@RpcParam.Int type: Int = -1,
@RpcParam.Int flags: Int = -1
)
}
/*
* libquassel
* Copyright (c) 2024 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.api.server
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.RpcApi
import de.justjanne.libquassel.annotations.RpcParam
import de.justjanne.libquassel.annotations.RpcCall
import de.justjanne.libquassel.protocol.models.ids.BufferId
import de.justjanne.libquassel.protocol.models.ids.MsgId
import de.justjanne.libquassel.protocol.variant.QVariantMap
@RpcApi("BufferSyncer", side = ProtocolSide.CLIENT)
interface BufferSyncerServerApi {
@RpcCall("requestMarkBufferAsRead")
fun requestMarkBufferAsRead(@RpcParam.UserType.BufferId buffer: BufferId)
@RpcCall("requestMergeBuffersPermanently")
fun requestMergeBuffersPermanently(
@RpcParam.UserType.BufferId buffer: BufferId,
@RpcParam.UserType.BufferId buffer2: BufferId
)
@RpcCall("requestRemoveBuffer")
fun requestRemoveBuffer(@RpcParam.UserType.BufferId buffer: BufferId)
@RpcCall("requestRenameBuffer")
fun requestRenameBuffer(
@RpcParam.UserType.BufferId buffer: BufferId,
@RpcParam.QString newName: String
)
@RpcCall("requestSetLastSeenMsg")
fun requestSetLastSeenMsg(
@RpcParam.UserType.BufferId buffer: BufferId,
@RpcParam.UserType.MsgId msgId: MsgId
)
@RpcCall("requestSetMarkerLine")
fun requestSetMarkerLine(
@RpcParam.UserType.BufferId buffer: BufferId,
@RpcParam.UserType.MsgId msgId: MsgId
)
@RpcCall("requestPurgeBufferIds")
fun requestPurgeBufferIds()
@RpcCall("requestUpdate")
fun requestUpdate(@RpcParam.QVariantMap properties: QVariantMap)
}
/*
* libquassel
* Copyright (c) 2024 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.api.server
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.RpcApi
import de.justjanne.libquassel.annotations.RpcParam
import de.justjanne.libquassel.annotations.RpcCall
import de.justjanne.libquassel.protocol.api.ObjectName
import de.justjanne.libquassel.protocol.models.ids.BufferId
import de.justjanne.libquassel.protocol.variant.QVariantMap
@RpcApi("BufferViewConfig", side = ProtocolSide.CLIENT)
interface BufferViewConfigServerApi {
@RpcCall("requestAddBuffer")
fun requestAddBuffer(objectName: ObjectName, @RpcParam.UserType.BufferId buffer: BufferId, @RpcParam.Int pos: Int)
@RpcCall("requestMoveBuffer")
fun requestMoveBuffer(objectName: ObjectName, @RpcParam.UserType.BufferId buffer: BufferId, @RpcParam.Int pos: Int)
@RpcCall("requestRemoveBuffer")
fun requestHideBuffer(objectName: ObjectName, @RpcParam.UserType.BufferId buffer: BufferId)
@RpcCall("requestRemoveBufferPermanently")
fun requestRemoveBuffer(objectName: ObjectName, @RpcParam.UserType.BufferId buffer: BufferId)
@RpcCall("requestSetBufferViewName")
fun requestSetBufferViewName(objectName: ObjectName, @RpcParam.QString value: String)
@RpcCall("requestUpdate")
fun requestUpdate(objectName: ObjectName, @RpcParam.QVariantMap properties: QVariantMap)
}
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
* Copyright (c) 2024 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.testutil.mocks
package de.justjanne.libquassel.protocol.api.server
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.protocol.session.SyncProxy
import de.justjanne.libquassel.protocol.syncables.SyncableStub
import de.justjanne.libquassel.annotations.RpcApi
import de.justjanne.libquassel.annotations.RpcParam
import de.justjanne.libquassel.annotations.RpcCall
import de.justjanne.libquassel.protocol.variant.QVariantList
import de.justjanne.libquassel.protocol.variant.QVariantMap
open class EmptySyncProxy : SyncProxy {
override fun synchronize(syncable: SyncableStub) = Unit
override fun stopSynchronize(syncable: SyncableStub) = Unit
@RpcApi("BufferViewManager", side = ProtocolSide.CLIENT)
interface BufferViewManagerServerApi {
@RpcCall("requestCreateBufferView")
fun requestCreateBufferView(@RpcParam.QVariantMap properties: QVariantMap)
override fun sync(
target: ProtocolSide,
className: String,
objectName: String,
function: String,
arguments: QVariantList
) = Unit
@RpcCall("requestCreateBufferViews")
fun requestCreateBufferViews(@RpcParam.QVariantList properties: QVariantList)
override fun rpc(target: ProtocolSide, function: String, arguments: QVariantList) = Unit
@RpcCall("requestDeleteBufferView")
fun requestDeleteBufferView(@RpcParam.Int bufferViewConfigId: Int)
}
/*
* libquassel
* Copyright (c) 2024 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.api.server
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.RpcApi
import de.justjanne.libquassel.annotations.RpcParam
import de.justjanne.libquassel.annotations.RpcCall
import de.justjanne.libquassel.protocol.api.ObjectName
import de.justjanne.libquassel.protocol.variant.QVariantMap
@RpcApi("CertManager", side = ProtocolSide.CLIENT)
interface CertManagerServerApi {
@RpcCall("requestUpdate")
fun requestUpdate(objectName: ObjectName, @RpcParam.QVariantMap properties: QVariantMap)
}
/*
* libquassel
* Copyright (c) 2024 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.api.server
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.RpcCall
import de.justjanne.libquassel.annotations.RpcApi
import de.justjanne.libquassel.annotations.RpcParam
@RpcApi("HighlightRuleManager", side = ProtocolSide.CLIENT)
interface HighlightRuleManagerServerApi {
@RpcCall("requestRemoveHighlightRule")
fun requestRemoveHighlightRule(@RpcParam.Int highlightRule: Int)
@RpcCall("requestToggleHighlightRule")
fun requestToggleHighlightRule(@RpcParam.Int highlightRule: Int)
@RpcCall("requestAddHighlightRule")
fun requestAddHighlightRule(
@RpcParam.Int id: Int,
@RpcParam.QString content: String?,
@RpcParam.Bool isRegEx: Boolean,
@RpcParam.Bool isCaseSensitive: Boolean,
@RpcParam.Bool isEnabled: Boolean,
@RpcParam.Bool isInverse: Boolean,
@RpcParam.QString sender: String?,
@RpcParam.QString channel: String?
)
@RpcCall(
"requestSetHighlightNick")
fun requestSetHighlightNick(@RpcParam.Int highlightNick: Int)
@RpcCall("requestSetNicksCaseSensitive")
fun requestSetNicksCaseSensitive(@RpcParam.Bool nicksCaseSensitive: Boolean)
}
/*
* libquassel
* Copyright (c) 2024 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.api.server
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.RpcCall
import de.justjanne.libquassel.annotations.RpcApi
import de.justjanne.libquassel.annotations.RpcParam
import de.justjanne.libquassel.protocol.api.ObjectName
import de.justjanne.libquassel.protocol.variant.QVariantMap
@RpcApi("Identity", side = ProtocolSide.CLIENT)
interface IdentityServerApi {
@RpcCall("requestUpdate")
fun requestUpdate(objectName: ObjectName, @RpcParam.QVariantMap properties: QVariantMap)
}
/*
* libquassel
* Copyright (c) 2024 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.api.server
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.RpcApi
import de.justjanne.libquassel.annotations.RpcCall
import de.justjanne.libquassel.annotations.RpcParam
@RpcApi("IgnoreListManager", side = ProtocolSide.CLIENT)
interface IgnoreListManagerServerApi {
@RpcCall("requestAddIgnoreListItem")
fun requestAddIgnoreListItem(
@RpcParam.Int type: Int,
@RpcParam.QString ignoreRule: String?,
@RpcParam.Bool isRegEx: Boolean,
@RpcParam.Int strictness: Int,
@RpcParam.Int scope: Int,
@RpcParam.QString scopeRule: String?,
@RpcParam.Bool isActive: Boolean
)
@RpcCall("requestRemoveIgnoreListItem")
fun requestRemoveIgnoreListItem(@RpcParam.QString ignoreRule: String?)
@RpcCall("requestToggleIgnoreRule")
fun requestToggleIgnoreRule(@RpcParam.QString ignoreRule: String?)
}
/*
* libquassel
* Copyright (c) 2024 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.api.server
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.RpcApi
import de.justjanne.libquassel.annotations.RpcParam
import de.justjanne.libquassel.annotations.RpcCall
import de.justjanne.libquassel.protocol.models.QStringList
import de.justjanne.libquassel.protocol.models.ids.NetworkId
@RpcApi("IrcListHelper", side = ProtocolSide.CLIENT)
interface IrcListHelperServerApi {
@RpcCall("requestChannelList")
fun requestChannelList(@RpcParam.UserType.NetworkId netId: NetworkId, @RpcParam.QStringList channelFilters: QStringList)
}
/*
* libquassel
* Copyright (c) 2024 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.api.server
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.RpcCall
import de.justjanne.libquassel.annotations.RpcApi
import de.justjanne.libquassel.annotations.RpcParam
@RpcApi("NetworkConfig", side = ProtocolSide.CLIENT)
interface NetworkConfigServerApi {
@RpcCall("requestSetAutoWhoDelay")
fun requestSetAutoWhoDelay(@RpcParam.Int delay: Int)
@RpcCall("requestSetAutoWhoEnabled")
fun requestSetAutoWhoEnabled(@RpcParam.Bool enabled: Boolean)
@RpcCall("requestSetAutoWhoInterval")
fun requestSetAutoWhoInterval(@RpcParam.Int interval: Int)
@RpcCall("requestSetAutoWhoNickLimit")
fun requestSetAutoWhoNickLimit(@RpcParam.Int limit: Int)
@RpcCall("requestSetMaxPingCount")
fun requestSetMaxPingCount(@RpcParam.Int count: Int)
@RpcCall("requestSetPingInterval")
fun requestSetPingInterval(@RpcParam.Int interval: Int)
@RpcCall("requestSetPingTimeoutEnabled")
fun requestSetPingTimeoutEnabled(@RpcParam.Bool enabled: Boolean)
@RpcCall("requestSetStandardCtcp")
fun requestSetStandardCtcp(@RpcParam.Bool enabled: Boolean)
}
/*
* libquassel
* Copyright (c) 2024 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.api.server
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.RpcCall
import de.justjanne.libquassel.annotations.RpcApi
import de.justjanne.libquassel.annotations.RpcParam
import de.justjanne.libquassel.protocol.api.ObjectName
import de.justjanne.libquassel.protocol.models.network.NetworkInfoDto
@RpcApi("Network", side = ProtocolSide.CLIENT)
interface NetworkServerApi {
@RpcCall("requestConnect")
fun requestConnect(objectName: ObjectName)
@RpcCall("requestDisconnect")
fun requestDisconnect(objectName: ObjectName)
@RpcCall("requestSetNetworkInfo")
fun requestSetNetworkInfo(objectName: ObjectName, @RpcParam.UserType.NetworkInfo info: NetworkInfoDto)
}
/*
* libquassel
* Copyright (c) 2024 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.api.server
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.RpcApi
import de.justjanne.libquassel.annotations.RpcCall
import de.justjanne.libquassel.annotations.RpcParam
import de.justjanne.libquassel.protocol.models.BufferInfo
import de.justjanne.libquassel.protocol.models.ids.IdentityId
import de.justjanne.libquassel.protocol.models.ids.NetworkId
import de.justjanne.libquassel.protocol.models.network.IdentityDto
import de.justjanne.libquassel.protocol.models.network.NetworkInfoDto
import de.justjanne.libquassel.protocol.variant.QVariantMap
@RpcApi(side = ProtocolSide.CLIENT)
interface RpcServerApi {
@RpcCall(name = "2createIdentity(Identity,QVariantMap)")
fun createIdentity(@RpcParam.UserType.Identity identity: IdentityDto, @RpcParam.QVariantMap additional: QVariantMap)
@RpcCall(name = "2removeIdentity(IdentityId)")
fun removeIdentity(@RpcParam.UserType.IdentityId identityId: IdentityId)
@RpcCall(name = "2createNetwork(NetworkInfo,QStringList)")
fun createNetwork(@RpcParam.UserType.NetworkInfo networkInfo: NetworkInfoDto, @RpcParam.QStringList channels: List<String>)
@RpcCall(name = "2removeNetwork(NetworkId)")
fun removeNetwork(@RpcParam.UserType.NetworkId networkId: NetworkId)
@RpcCall(name = "2changePassword(PeerPtr,QString,QString,QString)")
fun changePassword(@RpcParam.UserType.PeerPtr peerPtr: ULong, @RpcParam.QString user: String?, @RpcParam.QString old: String?, @RpcParam.QString new: String?)
@RpcCall(name = "2kickClient(int)")
fun requestKickClient(@RpcParam.Int id: Int)
@RpcCall(name = "2sendInput(BufferInfo,QString)")
fun sendInput(@RpcParam.UserType.BufferInfo bufferInfo: BufferInfo, @RpcParam.QString message: String?)
}
......@@ -10,14 +10,23 @@
plugins {
id("justjanne.kotlin")
id("justjanne.publication")
id("jacoco-report-aggregation")
}
repositories {
google()
mavenCentral()
}
dependencies {
api(project(":libquassel-api"))
api(project(":libquassel-persistence"))
api(project(":libquassel-protocol"))
testImplementation(libs.testcontainers)
implementation(libs.dagger.core)
ksp(libs.dagger.compiler)
implementation(libs.slf4j)
}
tasks.check {
dependsOn(tasks.named<JacocoReport>("testCodeCoverageReport"))
testImplementation(libs.room.runtime)
testImplementation(libs.sqlite)
}
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
* Copyright (c) 2024 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.util.collections
package de.justjanne.libquassel.backend
fun <T> List<T>.move(value: T, pos: Int = size): List<T> {
val newPos = pos.coerceIn(0, size)
val oldPos = indexOf(value)
import de.justjanne.libquassel.protocol.api.client.AliasManagerClientApi
import de.justjanne.libquassel.protocol.variant.QVariantMap
import javax.inject.Inject
return if (newPos == oldPos) this
else remove(value).insert(value, newPos)
class AliasManagerPersister @Inject constructor() : AliasManagerClientApi {
override fun update(properties: QVariantMap) = Unit
}
/*
* libquassel
* Copyright (c) 2024 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.backend
import de.justjanne.libquassel.protocol.api.client.BacklogManagerClientApi
import de.justjanne.libquassel.protocol.models.ids.BufferId
import de.justjanne.libquassel.protocol.models.ids.MsgId
import de.justjanne.libquassel.protocol.variant.QVariantList
import javax.inject.Inject
class BacklogManagerPersister @Inject constructor() : BacklogManagerClientApi {
override fun receiveBacklog(bufferId: BufferId, first: MsgId, last: MsgId, limit: Int, additional: Int, messages: QVariantList) = Unit
override fun receiveBacklogFiltered(bufferId: BufferId, first: MsgId, last: MsgId, limit: Int, additional: Int, type: Int, flags: Int, messages: QVariantList) = Unit
override fun receiveBacklogForward(bufferId: BufferId, first: MsgId, last: MsgId, limit: Int, type: Int, flags: Int, messages: QVariantList) = Unit
override fun receiveBacklogAll(first: MsgId, last: MsgId, limit: Int, additional: Int, messages: QVariantList) = Unit
override fun receiveBacklogAllFiltered(first: MsgId, last: MsgId, limit: Int, additional: Int, type: Int, flags: Int, messages: QVariantList) = Unit
}
/*
* libquassel
* Copyright (c) 2024 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.backend
import de.justjanne.libquassel.protocol.api.client.BufferSyncerClientApi
import de.justjanne.libquassel.protocol.models.ids.BufferId
import de.justjanne.libquassel.protocol.models.ids.MsgId
import de.justjanne.libquassel.protocol.variant.QVariantMap
import javax.inject.Inject
class BufferSyncerPersister @Inject constructor() : BufferSyncerClientApi {
override fun markBufferAsRead(buffer: BufferId) = Unit
override fun mergeBuffersPermanently(buffer: BufferId, buffer2: BufferId) = Unit
override fun removeBuffer(buffer: BufferId) = Unit
override fun renameBuffer(buffer: BufferId, newName: String) = Unit
override fun setMarkerLine(buffer: BufferId, msgId: MsgId) = Unit
override fun setLastSeenMsg(buffer: BufferId, msgId: MsgId) = Unit
override fun setBufferActivity(buffer: BufferId, types: Int) = Unit
override fun setHighlightCount(buffer: BufferId, count: Int) = Unit
override fun update(properties: QVariantMap) = Unit
}
/*
* libquassel
* Copyright (c) 2024 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.backend
import de.justjanne.libquassel.protocol.api.client.BufferViewConfigClientApi
import de.justjanne.libquassel.protocol.models.ids.BufferId
import de.justjanne.libquassel.protocol.models.ids.NetworkId
import de.justjanne.libquassel.protocol.variant.QVariantMap
import javax.inject.Inject
class BufferViewConfigPersister @Inject constructor(): BufferViewConfigClientApi {
override fun addBuffer(buffer: BufferId, pos: Int) = Unit
override fun moveBuffer(buffer: BufferId, pos: Int) = Unit
override fun removeBuffer(buffer: BufferId) = Unit
override fun removeBufferPermanently(buffer: BufferId) = Unit
override fun setBufferViewName(value: String) = Unit
override fun setAddNewBuffersAutomatically(value: Boolean) = Unit
override fun setAllowedBufferTypes(value: Int) = Unit
override fun setDisableDecoration(value: Boolean) = Unit
override fun setHideInactiveBuffers(value: Boolean) = Unit
override fun setHideInactiveNetworks(value: Boolean) = Unit
override fun setMinimumActivity(value: Int) = Unit
override fun setNetworkId(value: NetworkId) = Unit
override fun setShowSearch(value: Boolean) = Unit
override fun setSortAlphabetically(value: Boolean) = Unit
override fun update(properties: QVariantMap) = Unit
}
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
* Copyright (c) 2024 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.client.util
package de.justjanne.libquassel.backend
import kotlin.coroutines.Continuation
import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine
import de.justjanne.libquassel.protocol.api.client.BufferViewManagerClientApi
import de.justjanne.libquassel.protocol.variant.QVariantMap
import javax.inject.Inject
class CoroutineQueue<T> {
private val waiting = mutableListOf<Continuation<T>>()
suspend fun wait(): T = suspendCoroutine {
waiting.add(it)
}
suspend fun resume(value: T) {
for (continuation in waiting) {
continuation.resume(value)
}
waiting.clear()
}
class BufferViewManagerPersister @Inject constructor(): BufferViewManagerClientApi {
override fun addBufferViewConfig(bufferViewConfigId: Int) = Unit
override fun deleteBufferViewConfig(bufferViewConfigId: Int) = Unit
override fun update(properties: QVariantMap) = Unit
}
/*
* libquassel
* Copyright (c) 2024 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.backend
import de.justjanne.libquassel.protocol.api.ObjectName
import de.justjanne.libquassel.protocol.api.client.CertManagerClientApi
import de.justjanne.libquassel.protocol.variant.QVariantMap
import java.nio.ByteBuffer
import javax.inject.Inject
class CertManagerPersister @Inject constructor(): CertManagerClientApi {
override fun setSslCert(objectName: ObjectName, encoded: ByteBuffer) = Unit
override fun setSslKey(objectName: ObjectName, encoded: ByteBuffer) = Unit
override fun update(objectName: ObjectName, properties: QVariantMap) = Unit
}
import org.gradle.api.Project
/*
* libquassel
* Copyright (c) 2022 Janne Mareike Koschinski
* Copyright (c) 2024 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
version = cmd("git", "describe", "--always", "--tags", "HEAD") ?: "1.0.0"
package de.justjanne.libquassel.backend
import de.justjanne.libquassel.protocol.api.client.CoreInfoClientApi
import de.justjanne.libquassel.protocol.variant.QVariantMap
import javax.inject.Inject
fun Project.cmd(vararg command: String) = try {
val stdOut = java.io.ByteArrayOutputStream()
exec {
commandLine(*command)
standardOutput = stdOut
}
stdOut.toString(Charsets.UTF_8.name()).trim()
} catch (e: Throwable) {
null
class CoreInfoPersister @Inject constructor(): CoreInfoClientApi {
override fun setCoreData(data: QVariantMap) = Unit
override fun update(properties: QVariantMap) = Unit
}