|
@@ -220,8 +220,7 @@ func authPlainHandler(server *Server, client *Client, mechanism string, value []
|
220
|
220
|
return false
|
221
|
221
|
}
|
222
|
222
|
|
223
|
|
- client.Send(nil, server.name, RPL_LOGGEDIN, client.nick, client.nickMaskString, client.account.Name, fmt.Sprintf("You are now logged in as %s", client.account.Name))
|
224
|
|
- client.Send(nil, server.name, RPL_SASLSUCCESS, client.nick, "SASL authentication successful")
|
|
223
|
+ client.successfulSaslAuth()
|
225
|
224
|
return false
|
226
|
225
|
}
|
227
|
226
|
|
|
@@ -268,7 +267,17 @@ func authExternalHandler(server *Server, client *Client, mechanism string, value
|
268
|
267
|
return false
|
269
|
268
|
}
|
270
|
269
|
|
271
|
|
- client.Send(nil, server.name, RPL_LOGGEDIN, client.nick, client.nickMaskString, client.account.Name, fmt.Sprintf("You are now logged in as %s", client.account.Name))
|
272
|
|
- client.Send(nil, server.name, RPL_SASLSUCCESS, client.nick, "SASL authentication successful")
|
|
270
|
+ client.successfulSaslAuth()
|
273
|
271
|
return false
|
274
|
272
|
}
|
|
273
|
+
|
|
274
|
+// successfulSaslAuth means that a SASL auth attempt completed successfully, and is used to dispatch messages.
|
|
275
|
+func (c *Client) successfulSaslAuth() {
|
|
276
|
+ c.Send(nil, c.server.name, RPL_LOGGEDIN, c.nick, c.nickMaskString, c.account.Name, fmt.Sprintf("You are now logged in as %s", c.account.Name))
|
|
277
|
+ c.Send(nil, c.server.name, RPL_SASLSUCCESS, c.nick, "SASL authentication successful")
|
|
278
|
+
|
|
279
|
+ // dispatch account-notify
|
|
280
|
+ for friend := range c.Friends(AccountNotify) {
|
|
281
|
+ friend.Send(nil, c.nickMaskString, "ACCOUNT", c.account.Name)
|
|
282
|
+ }
|
|
283
|
+}
|