Browse Source

treat channel founder as such even if they don't have +q

This affects /TOPIC, /INVITE, and a few others.
tags/v2.1.0-rc1
Shivaram Lingamneni 4 years ago
parent
commit
c738a754a2
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      irc/channel.go

+ 5
- 0
irc/channel.go View File

515
 func (channel *Channel) ClientIsAtLeast(client *Client, permission modes.Mode) bool {
515
 func (channel *Channel) ClientIsAtLeast(client *Client, permission modes.Mode) bool {
516
 	channel.stateMutex.RLock()
516
 	channel.stateMutex.RLock()
517
 	clientModes := channel.members[client]
517
 	clientModes := channel.members[client]
518
+	founder := channel.registeredFounder
518
 	channel.stateMutex.RUnlock()
519
 	channel.stateMutex.RUnlock()
519
 
520
 
521
+	if founder != "" && founder == client.Account() {
522
+		return true
523
+	}
524
+
520
 	for _, mode := range modes.ChannelUserModes {
525
 	for _, mode := range modes.ChannelUserModes {
521
 		if clientModes.HasMode(mode) {
526
 		if clientModes.HasMode(mode) {
522
 			return true
527
 			return true

Loading…
Cancel
Save