mirror of
https://github.com/jeremyd/ergo.git
synced 2026-08-07 06:23:06 -07:00
implement draft/whoami
This commit is contained in:
@@ -255,6 +255,12 @@ CAPDEFS = [
|
||||
url="https://github.com/ircv3/ircv3-specifications/pull/613",
|
||||
standard="draft IRCv3",
|
||||
),
|
||||
CapDef(
|
||||
identifier="Whoami",
|
||||
name="draft/whoami",
|
||||
url="https://github.com/ircv3/ircv3-specifications/pull/603",
|
||||
standard="proposed IRCv3",
|
||||
),
|
||||
]
|
||||
|
||||
def validate_defs():
|
||||
|
||||
+6
-1
@@ -7,7 +7,7 @@ package caps
|
||||
|
||||
const (
|
||||
// number of recognized capabilities:
|
||||
numCapabs = 40
|
||||
numCapabs = 41
|
||||
// length of the uint32 array that represents the bitset:
|
||||
bitsetLen = 2
|
||||
)
|
||||
@@ -101,6 +101,10 @@ const (
|
||||
// https://github.com/ircv3/ircv3-specifications/pull/471
|
||||
WebPush Capability = iota
|
||||
|
||||
// Whoami is the proposed IRCv3 capability named "draft/whoami":
|
||||
// https://github.com/ircv3/ircv3-specifications/pull/603
|
||||
Whoami Capability = iota
|
||||
|
||||
// EchoMessage is the IRCv3 capability named "echo-message":
|
||||
// https://ircv3.net/specs/extensions/echo-message-3.2.html
|
||||
EchoMessage Capability = iota
|
||||
@@ -199,6 +203,7 @@ var (
|
||||
"draft/read-marker",
|
||||
"draft/relaymsg",
|
||||
"draft/webpush",
|
||||
"draft/whoami",
|
||||
"echo-message",
|
||||
"ergo.chat/nope",
|
||||
"extended-join",
|
||||
|
||||
@@ -524,6 +524,9 @@ func (server *Server) playRegistrationBurst(session *Session) {
|
||||
if !(rb.session.capabilities.Has(caps.ExtendedISupport) && rb.session.isupportSentPrereg) {
|
||||
server.RplISupport(c, rb)
|
||||
}
|
||||
if session.capabilities.Has(caps.Whoami) {
|
||||
rb.Add(nil, d.nickMask, "SETNAME", d.realname)
|
||||
}
|
||||
if session.capabilities.Has(caps.Metadata) {
|
||||
playMetadataVerbBatch(rb, d.nick, c.ListMetadata())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user