|
@@ -2730,6 +2730,11 @@ func sceneHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Res
|
2730
|
2730
|
// SETNAME <realname>
|
2731
|
2731
|
func setnameHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *ResponseBuffer) bool {
|
2732
|
2732
|
realname := msg.Params[0]
|
|
2733
|
+ if len(msg.Params) != 0 {
|
|
2734
|
+ // workaround for clients that turn unknown commands into raw IRC lines,
|
|
2735
|
+ // so you can do `/setname Jane Doe` in the client and get the expected result
|
|
2736
|
+ realname = strings.Join(msg.Params, " ")
|
|
2737
|
+ }
|
2733
|
2738
|
if realname == "" {
|
2734
|
2739
|
rb.Add(nil, server.name, "FAIL", "SETNAME", "INVALID_REALNAME", client.t("Realname is not valid"))
|
2735
|
2740
|
return false
|
|
@@ -2740,10 +2745,13 @@ func setnameHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *R
|
2740
|
2745
|
|
2741
|
2746
|
// alert friends
|
2742
|
2747
|
now := time.Now().UTC()
|
2743
|
|
- for session := range client.Friends(caps.SetName) {
|
|
2748
|
+ friends := client.Friends(caps.SetName)
|
|
2749
|
+ delete(friends, rb.session)
|
|
2750
|
+ for session := range friends {
|
2744
|
2751
|
session.sendFromClientInternal(false, now, "", details.nickMask, details.accountName, nil, "SETNAME", details.realname)
|
2745
|
2752
|
}
|
2746
|
|
-
|
|
2753
|
+ // respond to the user unconditionally, even if they don't have the cap
|
|
2754
|
+ rb.AddFromClient(now, "", details.nickMask, details.accountName, nil, "SETNAME", details.realname)
|
2747
|
2755
|
return false
|
2748
|
2756
|
}
|
2749
|
2757
|
|