mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-10 22:19:31 +01:00
commit
30914c564a
@ -171,6 +171,12 @@ CAPDEFS = [
|
|||||||
url="https://wiki.znc.in/Playback",
|
url="https://wiki.znc.in/Playback",
|
||||||
standard="ZNC vendor",
|
standard="ZNC vendor",
|
||||||
),
|
),
|
||||||
|
CapDef(
|
||||||
|
identifier="Nope",
|
||||||
|
name="oragono.io/nope",
|
||||||
|
url="https://oragono.io/nope",
|
||||||
|
standard="Oragono vendor",
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
def validate_defs():
|
def validate_defs():
|
||||||
|
@ -7,7 +7,7 @@ package caps
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
// number of recognized capabilities:
|
// number of recognized capabilities:
|
||||||
numCapabs = 26
|
numCapabs = 27
|
||||||
// length of the uint64 array that represents the bitset:
|
// length of the uint64 array that represents the bitset:
|
||||||
bitsetLen = 1
|
bitsetLen = 1
|
||||||
)
|
)
|
||||||
@ -116,6 +116,10 @@ const (
|
|||||||
// ZNCPlayback is the ZNC vendor capability named "znc.in/playback":
|
// ZNCPlayback is the ZNC vendor capability named "znc.in/playback":
|
||||||
// https://wiki.znc.in/Playback
|
// https://wiki.znc.in/Playback
|
||||||
ZNCPlayback Capability = iota
|
ZNCPlayback Capability = iota
|
||||||
|
|
||||||
|
// Nope is the Oragono vendor capability named "oragono.io/nope":
|
||||||
|
// https://oragono.io/nope
|
||||||
|
Nope Capability = iota
|
||||||
)
|
)
|
||||||
|
|
||||||
// `capabilityNames[capab]` is the string name of the capability `capab`
|
// `capabilityNames[capab]` is the string name of the capability `capab`
|
||||||
@ -147,5 +151,6 @@ var (
|
|||||||
"znc.in/self-message",
|
"znc.in/self-message",
|
||||||
"draft/event-playback",
|
"draft/event-playback",
|
||||||
"znc.in/playback",
|
"znc.in/playback",
|
||||||
|
"oragono.io/nope",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -574,6 +574,13 @@ func capHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Respo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// #511: oragono.io/nope is a fake cap to trap bad clients who blindly request
|
||||||
|
// every offered capability:
|
||||||
|
if toAdd.Has(caps.Nope) {
|
||||||
|
client.Quit(client.t("Requesting the oragono.io/nope CAP is forbidden"), rb.session)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
// update maxlenrest, just in case they altered the maxline cap
|
// update maxlenrest, just in case they altered the maxline cap
|
||||||
rb.session.SetMaxlenRest()
|
rb.session.SetMaxlenRest()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user