mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
implement metadata before-connect (#2281)
* metadata spec update: disallow colon entirely * refactor key validation * implement metadata before-connect * play the metadata in reg burst to all clients with the cap * bump irctest * remove all case normalization for keys From spec discussion, we will most likely either require keys to be lowercase, or else treat them as case-opaque, similar to message tag keys.
This commit is contained in:
parent
a5e435a26b
commit
73e51333ad
10 changed files with 199 additions and 59 deletions
|
|
@ -428,6 +428,8 @@ func (server *Server) tryRegister(c *Client, session *Session) (exiting bool) {
|
|||
c.SetMode(defaultMode, true)
|
||||
}
|
||||
|
||||
c.applyPreregMetadata(session)
|
||||
|
||||
// this is not a reattach, so if the client is always-on, this is the first time
|
||||
// the Client object was created during the current server uptime. mark dirty in
|
||||
// order to persist the realname and the user modes:
|
||||
|
|
@ -496,7 +498,7 @@ 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.Metadata) && c.AlwaysOn() {
|
||||
if session.capabilities.Has(caps.Metadata) {
|
||||
playMetadataList(rb, d.nick, d.nick, c.ListMetadata())
|
||||
}
|
||||
if d.account != "" && session.capabilities.Has(caps.Persistence) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue