Add +T no-CTCP usermode

This commit is contained in:
Conrad Lukawski 2020-06-08 14:43:58 -04:00
parent 425cdffe39
commit fca2900918
4 changed files with 11 additions and 2 deletions

View File

@ -1938,6 +1938,12 @@ func dispatchMessageToTarget(client *Client, tags map[string]string, histType hi
}
return
}
// Restrict CTCP message for target user with +T
if user.modes.HasMode(modes.UserNoCTCP) && message.IsRestrictedCTCPMessage() {
return
}
tDetails := user.Details()
tnick := tDetails.nick

View File

@ -51,6 +51,7 @@ Oragono supports the following channel modes:
+R | Only registered users can join the channel.
+s | Secret mode, channel won't show up in /LIST or whois replies.
+t | Only channel opers can modify the topic.
+C | Clients are blocked from sending CTCP messages in the channel.
= Prefixes =
@ -68,7 +69,8 @@ Oragono supports the following user modes:
+o | User is an IRC operator.
+R | User only accepts messages from other registered users.
+s | Server Notice Masks (see help with /HELPOP snomasks).
+Z | User is connected via TLS.`
+Z | User is connected via TLS.
+T | User is blocked from sending CTCP messages.`
snomaskHelpText = `== Server Notice Masks ==
Oragono supports the following server notice masks for operators:

View File

@ -34,7 +34,7 @@ func ApplyUserModeChanges(client *Client, changes modes.ModeChanges, force bool,
for _, change := range changes {
switch change.Mode {
case modes.Bot, modes.Invisible, modes.WallOps, modes.UserRoleplaying, modes.Operator, modes.LocalOperator, modes.RegisteredOnly:
case modes.Bot, modes.Invisible, modes.WallOps, modes.UserRoleplaying, modes.Operator, modes.LocalOperator, modes.RegisteredOnly, modes.UserNoCTCP:
switch change.Op {
case modes.Add:
if (change.Mode == modes.Operator || change.Mode == modes.LocalOperator) && !(force && oper != nil) {

View File

@ -105,6 +105,7 @@ const (
RegisteredOnly Mode = 'R'
ServerNotice Mode = 's'
TLS Mode = 'Z'
UserNoCTCP Mode = 'T'
UserRoleplaying Mode = 'E'
WallOps Mode = 'w'
)