|
@@ -54,14 +54,14 @@ enum class CapabilitiesNegotiationState {
|
54
|
54
|
* IRCv3 capabilities supported by the client.
|
55
|
55
|
*/
|
56
|
56
|
@Suppress("unused")
|
57
|
|
-sealed class Capability(val name: String) {
|
|
57
|
+sealed class Capability(vararg val names: String) {
|
58
|
58
|
// Capabilities that introduce extra commands:
|
59
|
59
|
/** Allows authentication using SASL via the AUTHENTICATE command. */
|
60
|
60
|
object SaslAuthentication : Capability("sasl")
|
61
|
61
|
|
62
|
62
|
// Capabilities that enable more information in message tags:
|
63
|
|
- /** Draft version of message tags, enables client-only tags. */
|
64
|
|
- object DraftMessageTags33 : Capability("draft/message-tags-0.2") // TODO: Add processor for TAGMSG
|
|
63
|
+ /** Generic support for message tags, including client-only tags. */
|
|
64
|
+ object DraftMessageTags33 : Capability("message-tags", "draft/message-tags-0.2") // TODO: Add processor for TAGMSG
|
65
|
65
|
|
66
|
66
|
/** Messages are tagged with the server time they originated at. */
|
67
|
67
|
object ServerTimeMessageTag : Capability("server-time")
|
|
@@ -102,5 +102,8 @@ sealed class Capability(val name: String) {
|
102
|
102
|
}
|
103
|
103
|
|
104
|
104
|
internal val capabilities: Map<String, Capability> by lazy {
|
105
|
|
- Capability::class.nestedClasses.map { it.objectInstance as Capability }.associateBy { it.name }
|
|
105
|
+ Capability::class.nestedClasses
|
|
106
|
+ .map { it.objectInstance as Capability }
|
|
107
|
+ .flatMap { it.names.map { name -> name to it } }
|
|
108
|
+ .toMap()
|
106
|
109
|
}
|