Procházet zdrojové kódy

move ChannelOperator check into hasPrivs helper

tags/v0.12.0
Shivaram Lingamneni před 5 roky
rodič
revize
ac08ce0f20
1 změnil soubory, kde provedl 2 přidání a 3 odebrání
  1. 2
    3
      irc/modes.go

+ 2
- 3
irc/modes.go Zobrazit soubor

@@ -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
 

Načítá se…
Zrušit
Uložit