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

fix: correct bug where method parameters weren’t correctly specified

parent 13bbac63
No related branches found
No related tags found
No related merge requests found
......@@ -449,10 +449,10 @@ class Network constructor(
_networkName = networkName
}
override fun setCurrentServer(currentServer: String) {
override fun setCurrentServer(currentServer: String?) {
if (_currentServer == currentServer)
return
_currentServer = currentServer
_currentServer = currentServer ?: ""
}
override fun setConnected(isConnected: Boolean) {
......@@ -461,7 +461,7 @@ class Network constructor(
_connected = isConnected
if (!isConnected) {
setMyNick("")
setCurrentServer("")
setCurrentServer(null)
removeChansAndUsers()
}
}
......@@ -473,10 +473,10 @@ class Network constructor(
live_connectionState.onNext(_connectionState)
}
override fun setMyNick(myNick: String) {
if (_myNick == myNick)
override fun setMyNick(myNick: String?) {
if (_myNick == myNick ?: "")
return
_myNick = myNick
_myNick = myNick ?: ""
if (_myNick.isEmpty() && ircUser(myNick()) == null) {
newIrcUser(myNick())
}
......@@ -614,19 +614,19 @@ class Network constructor(
_unlimitedMessageRate = unlimitedMessageRate
}
override fun setCodecForDecoding(codecForDecoding: ByteBuffer) {
setCodecForDecoding(Charsets.ISO_8859_1.decode(codecForDecoding).toString())
override fun setCodecForDecoding(codecForDecoding: ByteBuffer?) {
setCodecForDecoding(codecForDecoding?.let(Charsets.ISO_8859_1::decode)?.toString() ?: "")
}
override fun setCodecForEncoding(codecForEncoding: ByteBuffer) {
setCodecForEncoding(Charsets.ISO_8859_1.decode(codecForEncoding).toString())
override fun setCodecForEncoding(codecForEncoding: ByteBuffer?) {
setCodecForEncoding(codecForEncoding?.let(Charsets.ISO_8859_1::decode)?.toString() ?: "")
}
override fun setCodecForServer(codecForServer: ByteBuffer) {
setCodecForServer(Charsets.ISO_8859_1.decode(codecForServer).toString())
override fun setCodecForServer(codecForServer: ByteBuffer?) {
setCodecForServer(codecForServer?.let(Charsets.ISO_8859_1::decode)?.toString() ?: "")
}
override fun addSupport(param: String, value: String) {
override fun addSupport(param: String, value: String?) {
_supports[param] = value
}
......@@ -636,7 +636,7 @@ class Network constructor(
_supports.remove(param)
}
override fun addCap(capability: String, value: String) {
override fun addCap(capability: String, value: String?) {
_caps[capability.lowercase(Locale.ROOT)] = value
}
......
......@@ -67,7 +67,7 @@ interface INetwork : ISyncableObject {
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setCurrentServer(currentServer: String) {
fun setCurrentServer(currentServer: String?) {
sync(
target = ProtocolSide.CLIENT,
"setCurrentServer",
......@@ -76,7 +76,7 @@ interface INetwork : ISyncableObject {
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setMyNick(myNick: String) {
fun setMyNick(myNick: String?) {
sync(
target = ProtocolSide.CLIENT,
"setMyNick",
......@@ -94,7 +94,7 @@ interface INetwork : ISyncableObject {
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setCodecForServer(codecForServer: ByteBuffer) {
fun setCodecForServer(codecForServer: ByteBuffer?) {
sync(
target = ProtocolSide.CLIENT,
"setCodecForServer",
......@@ -103,7 +103,7 @@ interface INetwork : ISyncableObject {
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setCodecForEncoding(codecForEncoding: ByteBuffer) {
fun setCodecForEncoding(codecForEncoding: ByteBuffer?) {
sync(
target = ProtocolSide.CLIENT,
"setCodecForEncoding",
......@@ -112,7 +112,7 @@ interface INetwork : ISyncableObject {
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun setCodecForDecoding(codecForDecoding: ByteBuffer) {
fun setCodecForDecoding(codecForDecoding: ByteBuffer?) {
sync(
target = ProtocolSide.CLIENT,
"setCodecForDecoding",
......@@ -323,7 +323,7 @@ interface INetwork : ISyncableObject {
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun addSupport(param: String, value: String = "") {
fun addSupport(param: String, value: String? = null) {
sync(
target = ProtocolSide.CLIENT,
"addSupport",
......@@ -342,7 +342,7 @@ interface INetwork : ISyncableObject {
}
@SyncedCall(target = ProtocolSide.CLIENT)
fun addCap(capability: String, value: String = "") {
fun addCap(capability: String, value: String? = null) {
sync(
target = ProtocolSide.CLIENT,
"addCap",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment