toString override for ClientMessage

This commit is contained in:
2026-09-15 03:08:04 +01:00
parent 7c65309d99
commit cc0719a061
@@ -19,6 +19,8 @@ sealed class ClientMessage(val strName: String) {
} }
} }
override fun toString() = "$strName[params=$params trailing=:$trailing]"
class Ping(val token: String? = null) : ClientMessage("PING") { class Ping(val token: String? = null) : ClientMessage("PING") {
init { init {
require(token?.isNotEmpty() ?: true) { require(token?.isNotEmpty() ?: true) {
@@ -97,12 +99,13 @@ sealed class ClientMessage(val strName: String) {
get() = listOf(channel.chanName) get() = listOf(channel.chanName)
} }
// TODO RPL_ISUPPORT REQUIREMENTS IN FUN EG LINELEN STATUSMSG - ALSO ADD FUCKING STUPID STATUSMSG & SUPPORT FOR MASKS. FUCK ME
class PrivMsg(val target: IRCChannel, val message: String) : ClientMessage("PRIVMSG") { class PrivMsg(val target: IRCChannel, val message: String) : ClientMessage("PRIVMSG") {
override val params: kotlin.collections.List<String> override val params: kotlin.collections.List<String>
get() = get() =
listOf( listOf(
target.chanName, target.chanName,
) // TODO RPL_ISUPPORT REQUIREMENTS IN FUN EG LINELEN STATUSMSG - ALSO ADD FUCKING STUPID STATUSMSG & SUPPORT FOR MASKS. FUCK ME )
override val trailing: String override val trailing: String
get() = message get() = message