Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions irc/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion irc/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 =

Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion irc/modes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions irc/modes/modes.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ const (
RegisteredOnly Mode = 'R'
ServerNotice Mode = 's'
TLS Mode = 'Z'
UserNoCTCP Mode = 'T'
UserRoleplaying Mode = 'E'
WallOps Mode = 'w'
)
Expand Down