1
0
Fork 0
forked from External/ergo
This commit is contained in:
Shivaram Lingamneni 2020-03-20 08:11:12 -04:00
parent 4eaef9f772
commit 2d908eac8b
3 changed files with 108 additions and 2 deletions

View file

@ -281,7 +281,7 @@ func ParseChannelModeChanges(params ...string) (ModeChanges, map[rune]bool) {
} else {
continue
}
case Key, UserLimit:
case UserLimit:
// don't require value when removing
if change.Op == Add {
if len(params) > skipArgs {
@ -291,6 +291,23 @@ func ParseChannelModeChanges(params ...string) (ModeChanges, map[rune]bool) {
continue
}
}
case Key:
// #874: +k is technically a type B mode, requiring a parameter
// both for add and remove. so attempt to consume a parameter,
// but allow remove (but not add) even if no parameter is available.
// however, the remove parameter should always display as "*", matching
// the freenode behavior.
if len(params) > skipArgs {
if change.Op == Add {
change.Arg = params[skipArgs]
}
skipArgs++
} else if change.Op == Add {
continue
}
if change.Op == Remove {
change.Arg = "*"
}
}
var isKnown bool