Procházet zdrojové kódy

make channel founder unkickable

tags/v2.4.0-rc1
Shivaram Lingamneni před 3 roky
rodič
revize
32bb10f6c6
1 změnil soubory, kde provedl 6 přidání a 3 odebrání
  1. 6
    3
      irc/channel.go

+ 6
- 3
irc/channel.go Zobrazit soubor

@@ -553,9 +553,12 @@ func (channel *Channel) ClientHasPrivsOver(client *Client, target *Client) bool
553 553
 	targetModes := channel.members[target]
554 554
 	channel.stateMutex.RUnlock()
555 555
 
556
-	if founder != "" && founder == client.Account() {
557
-		// #950: founder can kick or whatever without actually having the +q mode
558
-		return true
556
+	if founder != "" {
557
+		if founder == client.Account() {
558
+			return true // #950: founder can take any privileged action without actually having +q
559
+		} else if founder == target.Account() {
560
+			return false // conversely, only the founder can kick the founder
561
+		}
559 562
 	}
560 563
 
561 564
 	return channelUserModeHasPrivsOver(clientModes.HighestChannelUserMode(), targetModes.HighestChannelUserMode())

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