3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-25 13:29:27 +01:00

Merge pull request #1123 from clukawski/no-ctcp-user-mode

Add +T no-CTCP usermode
This commit is contained in:
Shivaram Lingamneni 2020-06-27 21:13:24 -07:00 committed by GitHub
commit d7a62223a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 2 deletions

View File

@ -2019,6 +2019,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'
)