Browse Source

Merge pull request #515 from slingamn/issue514

fix #514
tags/v1.1.0-rc1
Daniel Oaks 5 years ago
parent
commit
caa6de941c
No account linked to committer's email address
2 changed files with 4 additions and 1 deletions
  1. 1
    1
      irc/channel.go
  2. 3
    0
      irc/modes.go

+ 1
- 1
irc/channel.go View File

395
 		return targetMode != modes.ChannelFounder && targetMode != modes.ChannelAdmin
395
 		return targetMode != modes.ChannelFounder && targetMode != modes.ChannelAdmin
396
 	case modes.Halfop:
396
 	case modes.Halfop:
397
 		// halfops cannot kick other halfops
397
 		// halfops cannot kick other halfops
398
-		return targetMode != modes.ChannelFounder && targetMode != modes.ChannelAdmin && targetMode != modes.Halfop
398
+		return targetMode == modes.Voice || targetMode == modes.Mode(0)
399
 	default:
399
 	default:
400
 		// voice and unprivileged cannot kick anyone
400
 		// voice and unprivileged cannot kick anyone
401
 		return false
401
 		return false

+ 3
- 0
irc/modes.go View File

277
 		hasPrivs = true
277
 		hasPrivs = true
278
 	} else if channelUserModeHasPrivsOver(clientMode, targetModeNow) && channelUserModeHasPrivsOver(clientMode, targetModeAfter) {
278
 	} else if channelUserModeHasPrivsOver(clientMode, targetModeNow) && channelUserModeHasPrivsOver(clientMode, targetModeAfter) {
279
 		hasPrivs = true
279
 		hasPrivs = true
280
+	} else if change.Op == modes.Remove && account == change.Arg {
281
+		// you can always de-op yourself
282
+		hasPrivs = true
280
 	}
283
 	}
281
 	if !hasPrivs {
284
 	if !hasPrivs {
282
 		return nil, errInsufficientPrivs
285
 		return nil, errInsufficientPrivs

Loading…
Cancel
Save