mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-10 22:19:31 +01:00
parent
66e2710ba2
commit
166dc60729
@ -608,6 +608,10 @@ This mode is enabled by default, and means that only channel operators can chang
|
||||
|
||||
If this mode is unset, anyone will be able to change the channel topic.
|
||||
|
||||
### +C - No CTCPs
|
||||
|
||||
This mode means that [client-to-client protocol](https://tools.ietf.org/id/draft-oakley-irc-ctcp-01.html) messages other than `ACTION` (`/me`) cannot be sent to the channel.
|
||||
|
||||
|
||||
## Channel Prefixes
|
||||
|
||||
|
@ -1070,6 +1070,14 @@ func (channel *Channel) SendSplitMessage(command string, minPrefixMode modes.Mod
|
||||
return
|
||||
}
|
||||
|
||||
isCTCP := message.IsRestrictedCTCPMessage()
|
||||
if isCTCP && channel.flags.HasMode(modes.NoCTCP) {
|
||||
if histType != history.Notice {
|
||||
rb.Add(nil, client.server.name, ERR_CANNOTSENDTOCHAN, client.Nick(), channel.Name(), fmt.Sprintf(client.t("Cannot send to channel (+%s)"), "C"))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
nickmask := client.NickMaskString()
|
||||
account := client.AccountName()
|
||||
chname := channel.Name()
|
||||
@ -1116,6 +1124,9 @@ func (channel *Channel) SendSplitMessage(command string, minPrefixMode modes.Mod
|
||||
// STATUSMSG
|
||||
continue
|
||||
}
|
||||
if isCTCP && member.isTor {
|
||||
continue // #753
|
||||
}
|
||||
|
||||
for _, session := range member.Sessions() {
|
||||
var tagsToUse map[string]string
|
||||
|
@ -221,7 +221,7 @@ func (channel *Channel) ApplyChannelModeChanges(client *Client, isSamode bool, c
|
||||
applied = append(applied, change)
|
||||
}
|
||||
|
||||
case modes.InviteOnly, modes.Moderated, modes.NoOutside, modes.OpOnlyTopic, modes.RegisteredOnly, modes.Secret, modes.ChanRoleplaying:
|
||||
case modes.InviteOnly, modes.Moderated, modes.NoOutside, modes.OpOnlyTopic, modes.RegisteredOnly, modes.Secret, modes.ChanRoleplaying, modes.NoCTCP:
|
||||
if change.Op == modes.List {
|
||||
continue
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ var (
|
||||
SupportedChannelModes = Modes{
|
||||
BanMask, ChanRoleplaying, ExceptMask, InviteMask, InviteOnly, Key,
|
||||
Moderated, NoOutside, OpOnlyTopic, RegisteredOnly, Secret, UserLimit,
|
||||
NoCTCP,
|
||||
}
|
||||
)
|
||||
|
||||
@ -132,6 +133,7 @@ const (
|
||||
// RegisteredOnly mode is reused here from umode definition
|
||||
Secret Mode = 's' // flag
|
||||
UserLimit Mode = 'l' // flag arg
|
||||
NoCTCP Mode = 'C' // flag
|
||||
)
|
||||
|
||||
var (
|
||||
|
Loading…
Reference in New Issue
Block a user