Browse Source

move ChannelOperator check into hasPrivs helper

tags/v0.12.0
Shivaram Lingamneni 5 years ago
parent
commit
ac08ce0f20
1 changed files with 2 additions and 3 deletions
  1. 2
    3
      irc/modes.go

+ 2
- 3
irc/modes.go View File

@@ -108,7 +108,6 @@ func (channel *Channel) ApplyChannelModeChanges(client *Client, isSamode bool, c
108 108
 	// so we only output one warning for each list type when full
109 109
 	listFullWarned := make(map[modes.Mode]bool)
110 110
 
111
-	clientIsOp := channel.ClientIsAtLeast(client, modes.ChannelOperator)
112 111
 	var alreadySentPrivError bool
113 112
 
114 113
 	applied := make(modes.ModeChanges, 0)
@@ -141,9 +140,9 @@ func (channel *Channel) ApplyChannelModeChanges(client *Client, isSamode bool, c
141 140
 			return channel.ClientIsAtLeast(client, change.Mode)
142 141
 		case modes.BanMask:
143 142
 			// #163: allow unprivileged users to list ban masks
144
-			return clientIsOp || isListOp(change)
143
+			return isListOp(change) || channel.ClientIsAtLeast(client, modes.ChannelOperator)
145 144
 		default:
146
-			return clientIsOp
145
+			return channel.ClientIsAtLeast(client, modes.ChannelOperator)
147 146
 		}
148 147
 	}
149 148
 

Loading…
Cancel
Save