mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-11 06:29:29 +01:00
fix #1259
This commit is contained in:
parent
2d277566b5
commit
20aaa1ab06
@ -100,10 +100,10 @@ CAPDEFS = [
|
|||||||
standard="proposed IRCv3",
|
standard="proposed IRCv3",
|
||||||
),
|
),
|
||||||
CapDef(
|
CapDef(
|
||||||
identifier="Rename",
|
identifier="ChannelRename",
|
||||||
name="draft/rename",
|
name="draft/channel-rename",
|
||||||
url="https://github.com/SaberUK/ircv3-specifications/blob/rename/extensions/rename.md",
|
url="https://ircv3.net/specs/extensions/channel-rename",
|
||||||
standard="proposed IRCv3",
|
standard="draft IRCv3",
|
||||||
),
|
),
|
||||||
CapDef(
|
CapDef(
|
||||||
identifier="Resume",
|
identifier="Resume",
|
||||||
|
@ -37,6 +37,10 @@ const (
|
|||||||
// https://ircv3.net/specs/extensions/chghost-3.2.html
|
// https://ircv3.net/specs/extensions/chghost-3.2.html
|
||||||
ChgHost Capability = iota
|
ChgHost Capability = iota
|
||||||
|
|
||||||
|
// ChannelRename is the draft IRCv3 capability named "draft/channel-rename":
|
||||||
|
// https://ircv3.net/specs/extensions/channel-rename
|
||||||
|
ChannelRename Capability = iota
|
||||||
|
|
||||||
// Chathistory is the proposed IRCv3 capability named "draft/chathistory":
|
// Chathistory is the proposed IRCv3 capability named "draft/chathistory":
|
||||||
// https://github.com/ircv3/ircv3-specifications/pull/393
|
// https://github.com/ircv3/ircv3-specifications/pull/393
|
||||||
Chathistory Capability = iota
|
Chathistory Capability = iota
|
||||||
@ -57,10 +61,6 @@ const (
|
|||||||
// https://github.com/ircv3/ircv3-specifications/pull/417
|
// https://github.com/ircv3/ircv3-specifications/pull/417
|
||||||
Relaymsg Capability = iota
|
Relaymsg Capability = iota
|
||||||
|
|
||||||
// Rename is the proposed IRCv3 capability named "draft/rename":
|
|
||||||
// https://github.com/SaberUK/ircv3-specifications/blob/rename/extensions/rename.md
|
|
||||||
Rename Capability = iota
|
|
||||||
|
|
||||||
// Resume is the proposed IRCv3 capability named "draft/resume-0.5":
|
// Resume is the proposed IRCv3 capability named "draft/resume-0.5":
|
||||||
// https://github.com/DanielOaks/ircv3-specifications/blob/master+resume/extensions/resume.md
|
// https://github.com/DanielOaks/ircv3-specifications/blob/master+resume/extensions/resume.md
|
||||||
Resume Capability = iota
|
Resume Capability = iota
|
||||||
@ -131,12 +131,12 @@ var (
|
|||||||
"batch",
|
"batch",
|
||||||
"cap-notify",
|
"cap-notify",
|
||||||
"chghost",
|
"chghost",
|
||||||
|
"draft/channel-rename",
|
||||||
"draft/chathistory",
|
"draft/chathistory",
|
||||||
"draft/event-playback",
|
"draft/event-playback",
|
||||||
"draft/languages",
|
"draft/languages",
|
||||||
"draft/multiline",
|
"draft/multiline",
|
||||||
"draft/relaymsg",
|
"draft/relaymsg",
|
||||||
"draft/rename",
|
|
||||||
"draft/resume-0.5",
|
"draft/resume-0.5",
|
||||||
"echo-message",
|
"echo-message",
|
||||||
"extended-join",
|
"extended-join",
|
||||||
|
@ -78,14 +78,14 @@ func BenchmarkSetReads(b *testing.B) {
|
|||||||
set.Has(UserhostInNames)
|
set.Has(UserhostInNames)
|
||||||
set.Has(LabeledResponse)
|
set.Has(LabeledResponse)
|
||||||
set.Has(EchoMessage)
|
set.Has(EchoMessage)
|
||||||
set.Has(Rename)
|
set.Has(Nope)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func BenchmarkSetWrites(b *testing.B) {
|
func BenchmarkSetWrites(b *testing.B) {
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
set := NewSet(UserhostInNames, EchoMessage)
|
set := NewSet(UserhostInNames, EchoMessage)
|
||||||
set.Add(Rename)
|
set.Add(Nope)
|
||||||
set.Add(ExtendedJoin)
|
set.Add(ExtendedJoin)
|
||||||
set.Remove(UserhostInNames)
|
set.Remove(UserhostInNames)
|
||||||
set.Remove(LabeledResponse)
|
set.Remove(LabeledResponse)
|
||||||
|
@ -2554,7 +2554,7 @@ func renameHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Re
|
|||||||
targetRb = NewResponseBuffer(mSession)
|
targetRb = NewResponseBuffer(mSession)
|
||||||
targetPrefix = mDetails.nickMask
|
targetPrefix = mDetails.nickMask
|
||||||
}
|
}
|
||||||
if mSession.capabilities.Has(caps.Rename) {
|
if mSession.capabilities.Has(caps.ChannelRename) {
|
||||||
if reason != "" {
|
if reason != "" {
|
||||||
targetRb.Add(nil, clientPrefix, "RENAME", oldName, newName, reason)
|
targetRb.Add(nil, clientPrefix, "RENAME", oldName, newName, reason)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user