mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-22 18:52:41 +01:00
fix a regression introduced by #444
This commit is contained in:
parent
baa7e5af0b
commit
26cddf2f59
@ -2244,28 +2244,30 @@ func renameHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Re
|
|||||||
go server.channelRegistry.Rename(channel, casefoldedOldName)
|
go server.channelRegistry.Rename(channel, casefoldedOldName)
|
||||||
|
|
||||||
// send RENAME messages
|
// send RENAME messages
|
||||||
|
clientPrefix := client.NickMaskString()
|
||||||
for _, mcl := range channel.Members() {
|
for _, mcl := range channel.Members() {
|
||||||
targetRb := rb
|
targetRb := rb
|
||||||
|
targetPrefix := clientPrefix
|
||||||
if mcl != client {
|
if mcl != client {
|
||||||
targetRb = NewResponseBuffer(mcl)
|
targetRb = NewResponseBuffer(mcl)
|
||||||
|
targetPrefix = mcl.NickMaskString()
|
||||||
}
|
}
|
||||||
prefix := mcl.NickMaskString()
|
|
||||||
if mcl.capabilities.Has(caps.Rename) {
|
if mcl.capabilities.Has(caps.Rename) {
|
||||||
if reason != "" {
|
if reason != "" {
|
||||||
targetRb.Add(nil, prefix, "RENAME", oldName, newName, reason)
|
targetRb.Add(nil, clientPrefix, "RENAME", oldName, newName, reason)
|
||||||
} else {
|
} else {
|
||||||
targetRb.Add(nil, prefix, "RENAME", oldName, newName)
|
targetRb.Add(nil, clientPrefix, "RENAME", oldName, newName)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if reason != "" {
|
if reason != "" {
|
||||||
targetRb.Add(nil, prefix, "PART", oldName, fmt.Sprintf(mcl.t("Channel renamed: %s"), reason))
|
targetRb.Add(nil, targetPrefix, "PART", oldName, fmt.Sprintf(mcl.t("Channel renamed: %s"), reason))
|
||||||
} else {
|
} else {
|
||||||
targetRb.Add(nil, prefix, "PART", oldName, fmt.Sprintf(mcl.t("Channel renamed")))
|
targetRb.Add(nil, targetPrefix, "PART", oldName, fmt.Sprintf(mcl.t("Channel renamed")))
|
||||||
}
|
}
|
||||||
if mcl.capabilities.Has(caps.ExtendedJoin) {
|
if mcl.capabilities.Has(caps.ExtendedJoin) {
|
||||||
targetRb.Add(nil, prefix, "JOIN", newName, mcl.AccountName(), mcl.Realname())
|
targetRb.Add(nil, targetPrefix, "JOIN", newName, mcl.AccountName(), mcl.Realname())
|
||||||
} else {
|
} else {
|
||||||
targetRb.Add(nil, prefix, "JOIN", newName)
|
targetRb.Add(nil, targetPrefix, "JOIN", newName)
|
||||||
}
|
}
|
||||||
channel.SendTopic(mcl, targetRb, false)
|
channel.SendTopic(mcl, targetRb, false)
|
||||||
channel.Names(mcl, targetRb)
|
channel.Names(mcl, targetRb)
|
||||||
|
Loading…
Reference in New Issue
Block a user