mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-22 11:59:40 +01:00
fix #1396
* Defer account login snomask until after connection registration is complete * Don't send account-notify for pre-registration clients
This commit is contained in:
parent
0e470763a2
commit
c62956f708
@ -102,21 +102,26 @@ func sendSuccessfulAccountAuth(service *ircService, client *Client, rb *Response
|
||||
}
|
||||
}
|
||||
|
||||
// dispatch account-notify
|
||||
for friend := range client.Friends(caps.AccountNotify) {
|
||||
if friend != rb.session {
|
||||
friend.Send(nil, details.nickMask, "ACCOUNT", details.accountName)
|
||||
if client.Registered() {
|
||||
// dispatch account-notify
|
||||
for friend := range client.Friends(caps.AccountNotify) {
|
||||
if friend != rb.session {
|
||||
friend.Send(nil, details.nickMask, "ACCOUNT", details.accountName)
|
||||
}
|
||||
}
|
||||
if rb.session.capabilities.Has(caps.AccountNotify) {
|
||||
rb.Add(nil, details.nickMask, "ACCOUNT", details.accountName)
|
||||
}
|
||||
client.server.sendLoginSnomask(details.nickMask, details.accountName)
|
||||
}
|
||||
if rb.session.capabilities.Has(caps.AccountNotify) {
|
||||
rb.Add(nil, details.nickMask, "ACCOUNT", details.accountName)
|
||||
}
|
||||
|
||||
client.server.snomasks.Send(sno.LocalAccounts, fmt.Sprintf(ircfmt.Unescape("Client $c[grey][$r%s$c[grey]] logged into account $c[grey][$r%s$c[grey]]"), details.nickMask, details.accountName))
|
||||
|
||||
client.server.logger.Info("accounts", "client", details.nick, "logged into account", details.accountName)
|
||||
}
|
||||
|
||||
func (server *Server) sendLoginSnomask(nickMask, accountName string) {
|
||||
server.snomasks.Send(sno.LocalAccounts, fmt.Sprintf(ircfmt.Unescape("Client $c[grey][$r%s$c[grey]] logged into account $c[grey][$r%s$c[grey]]"), nickMask, accountName))
|
||||
}
|
||||
|
||||
// AUTHENTICATE [<mechanism>|<data>|*]
|
||||
func authenticateHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *ResponseBuffer) bool {
|
||||
session := rb.session
|
||||
|
@ -344,6 +344,9 @@ func (server *Server) playRegistrationBurst(session *Session) {
|
||||
d := c.Details()
|
||||
server.logger.Info("connect", fmt.Sprintf("Client connected [%s] [u:%s] [r:%s]", d.nick, d.username, d.realname))
|
||||
server.snomasks.Send(sno.LocalConnects, fmt.Sprintf("Client connected [%s] [u:%s] [h:%s] [ip:%s] [r:%s]", d.nick, d.username, session.rawHostname, session.IP().String(), d.realname))
|
||||
if d.account != "" {
|
||||
server.sendLoginSnomask(d.nickMask, d.accountName)
|
||||
}
|
||||
|
||||
// send welcome text
|
||||
//NOTE(dan): we specifically use the NICK here instead of the nickmask
|
||||
|
Loading…
Reference in New Issue
Block a user