mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-22 10:42:52 +01:00
fix #1019
This commit is contained in:
parent
1ab06949bf
commit
a397756882
@ -233,6 +233,11 @@ func (clients *ClientManager) SetNick(client *Client, session *Session, newNick
|
|||||||
currentClient.SetNames("user", realname, true)
|
currentClient.SetNames("user", realname, true)
|
||||||
// successful reattach!
|
// successful reattach!
|
||||||
return newNick, nil
|
return newNick, nil
|
||||||
|
} else if currentClient == client && currentClient.Nick() == newNick {
|
||||||
|
// see #1019: normally no-op nick changes are caught earlier, by performNickChange,
|
||||||
|
// but they are not detected there when force-guest-format is enabled (because
|
||||||
|
// the proposed nickname is e.g. alice and the current nickname is Guest-alice)
|
||||||
|
return "", errNoop
|
||||||
}
|
}
|
||||||
// analogous checks for skeletons
|
// analogous checks for skeletons
|
||||||
skeletonHolder := clients.bySkeleton[newSkeleton]
|
skeletonHolder := clients.bySkeleton[newSkeleton]
|
||||||
|
@ -47,6 +47,8 @@ func performNickChange(server *Server, client *Client, target *Client, session *
|
|||||||
rb.Add(nil, server.name, ERR_UNKNOWNERROR, currentNick, "NICK", client.t("You must use your account name as your nickname"))
|
rb.Add(nil, server.name, ERR_UNKNOWNERROR, currentNick, "NICK", client.t("You must use your account name as your nickname"))
|
||||||
} else if err == errNickMissing {
|
} else if err == errNickMissing {
|
||||||
rb.Add(nil, server.name, ERR_NONICKNAMEGIVEN, currentNick, client.t("No nickname given"))
|
rb.Add(nil, server.name, ERR_NONICKNAMEGIVEN, currentNick, client.t("No nickname given"))
|
||||||
|
} else if err == errNoop {
|
||||||
|
// no message
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
rb.Add(nil, server.name, ERR_UNKNOWNERROR, currentNick, "NICK", fmt.Sprintf(client.t("Could not set or change nickname: %s"), err.Error()))
|
rb.Add(nil, server.name, ERR_UNKNOWNERROR, currentNick, "NICK", fmt.Sprintf(client.t("Could not set or change nickname: %s"), err.Error()))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user