1
0
Fork 0
forked from External/ergo

Merge pull request #1163 from slingamn/list_issue1161

fix #1161
This commit is contained in:
Shivaram Lingamneni 2020-06-30 17:43:48 -07:00 committed by GitHub
commit 79764cd549
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 22 deletions

View file

@ -970,26 +970,6 @@ func (matcher *elistMatcher) Matches(channel *Channel) bool {
return true
}
// RplList returns the RPL_LIST numeric for the given channel.
func (target *Client) RplList(channel *Channel, rb *ResponseBuffer) {
// get the correct number of channel members
var memberCount int
if target.HasMode(modes.Operator) || channel.hasClient(target) {
memberCount = len(channel.Members())
} else {
for _, member := range channel.Members() {
if !member.HasMode(modes.Invisible) {
memberCount++
}
}
}
// #704: some channels are kept around even with no members
if memberCount != 0 {
rb.Add(nil, target.server.name, RPL_LIST, target.nick, channel.name, strconv.Itoa(memberCount), channel.topic)
}
}
var (
infoString1 = strings.Split(` ·
·