|
@@ -57,6 +57,12 @@ class ServerState internal constructor(
|
57
|
57
|
val channelModePrefixes
|
58
|
58
|
get() = features[ServerFeature.ModePrefixes] ?: throw IllegalStateException("lost mode prefixes")
|
59
|
59
|
|
|
60
|
+ /**
|
|
61
|
+ * Convenience accessor for the [ServerFeature.ChannelTypes] feature, which will always have a value.
|
|
62
|
+ */
|
|
63
|
+ val channelTypes
|
|
64
|
+ get() = features[ServerFeature.ChannelTypes] ?: throw IllegalStateException("lost channel types")
|
|
65
|
+
|
60
|
66
|
/**
|
61
|
67
|
* Determines if the given mode is one applied to a user of a channel, such as 'o' for operator.
|
62
|
68
|
*/
|
|
@@ -148,6 +154,8 @@ sealed class ServerFeature<T : Any>(val name: String, val type: KClass<T>, val d
|
148
|
154
|
object MaximumChannels : ServerFeature<Int>("MAXCHANNELS", Int::class) // TODO: CHANLIMIT also exists
|
149
|
155
|
/** The modes supported in channels. */
|
150
|
156
|
object ChannelModes : ServerFeature<Array<String>>("CHANMODES", Array<String>::class)
|
|
157
|
+ /** The types of channels supported. */
|
|
158
|
+ object ChannelTypes : ServerFeature<String>("CHANTYPES", String::class, "#&")
|
151
|
159
|
/** The maximum length of a channel name, defaulting to 200. */
|
152
|
160
|
object MaximumChannelNameLength : ServerFeature<Int>("CHANNELLEN", Int::class, 200)
|
153
|
161
|
/** Whether or not the server supports extended who. */
|