Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

constants.go 3.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // Copyright (c) 2017 Daniel Oaks <daniel@danieloaks.net>
  2. // released under the MIT license
  3. package caps
  4. // Capability represents an optional feature that a client may request from the server.
  5. type Capability string
  6. const (
  7. // LabelTagName is the tag name used for the labeled-response spec.
  8. LabelTagName = "draft/label"
  9. // AccountNotify is this IRCv3 capability: http://ircv3.net/specs/extensions/account-notify-3.1.html
  10. AccountNotify Capability = "account-notify"
  11. // AccountTag is this IRCv3 capability: http://ircv3.net/specs/extensions/account-tag-3.2.html
  12. AccountTag Capability = "account-tag"
  13. // AwayNotify is this IRCv3 capability: http://ircv3.net/specs/extensions/away-notify-3.1.html
  14. AwayNotify Capability = "away-notify"
  15. // Batch is this IRCv3 capability: http://ircv3.net/specs/extensions/batch-3.2.html
  16. Batch Capability = "batch"
  17. // CapNotify is this IRCv3 capability: http://ircv3.net/specs/extensions/cap-notify-3.2.html
  18. CapNotify Capability = "cap-notify"
  19. // ChgHost is this IRCv3 capability: http://ircv3.net/specs/extensions/chghost-3.2.html
  20. ChgHost Capability = "chghost"
  21. // EchoMessage is this IRCv3 capability: http://ircv3.net/specs/extensions/echo-message-3.2.html
  22. EchoMessage Capability = "echo-message"
  23. // ExtendedJoin is this IRCv3 capability: http://ircv3.net/specs/extensions/extended-join-3.1.html
  24. ExtendedJoin Capability = "extended-join"
  25. // InviteNotify is this IRCv3 capability: http://ircv3.net/specs/extensions/invite-notify-3.2.html
  26. InviteNotify Capability = "invite-notify"
  27. // LabeledResponse is this draft IRCv3 capability: http://ircv3.net/specs/extensions/labeled-response.html
  28. LabeledResponse Capability = "draft/labeled-response"
  29. // Languages is this proposed IRCv3 capability: https://gist.github.com/DanielOaks/8126122f74b26012a3de37db80e4e0c6
  30. Languages Capability = "draft/languages"
  31. // MaxLine is this capability: https://oragono.io/maxline
  32. MaxLine Capability = "oragono.io/maxline"
  33. // MessageTags is this draft IRCv3 capability: http://ircv3.net/specs/core/message-tags-3.3.html
  34. MessageTags Capability = "draft/message-tags-0.2"
  35. // MultiPrefix is this IRCv3 capability: http://ircv3.net/specs/extensions/multi-prefix-3.1.html
  36. MultiPrefix Capability = "multi-prefix"
  37. // Rename is this proposed capability: https://github.com/SaberUK/ircv3-specifications/blob/rename/extensions/rename.md
  38. Rename Capability = "draft/rename"
  39. // Resume is this proposed capability: https://github.com/DanielOaks/ircv3-specifications/blob/master+resume/extensions/resume.md
  40. Resume Capability = "draft/resume"
  41. // SASL is this IRCv3 capability: http://ircv3.net/specs/extensions/sasl-3.2.html
  42. SASL Capability = "sasl"
  43. // ServerTime is this IRCv3 capability: http://ircv3.net/specs/extensions/server-time-3.2.html
  44. ServerTime Capability = "server-time"
  45. // STS is this IRCv3 capability: http://ircv3.net/specs/extensions/sts.html
  46. STS Capability = "sts"
  47. // UserhostInNames is this IRCv3 capability: http://ircv3.net/specs/extensions/userhost-in-names-3.2.html
  48. UserhostInNames Capability = "userhost-in-names"
  49. )
  50. // Name returns the name of the given capability.
  51. func (capability Capability) Name() string {
  52. return string(capability)
  53. }
  54. // Version is used to select which max version of CAP the client supports.
  55. type Version uint
  56. const (
  57. // Cap301 refers to the base CAP spec.
  58. Cap301 Version = 301
  59. // Cap302 refers to the IRCv3.2 CAP spec.
  60. Cap302 Version = 302
  61. )
  62. // State shows whether we're negotiating caps, finished, etc for connection registration.
  63. type State uint
  64. const (
  65. // NoneState means CAP hasn't been negotiated at all.
  66. NoneState State = iota
  67. // NegotiatingState means CAP is being negotiated and registration should be paused.
  68. NegotiatingState State = iota
  69. // NegotiatedState means CAP negotiation has been successfully ended and reg should complete.
  70. NegotiatedState State = iota
  71. )