1
0
Fork 0
forked from External/ergo

Enhancements to CS PURGE

1. Consolidate PURGE and UNPURGE into subcommands
2. Add PURGE LIST
3. PURGE ADD now requires a confirmation code

Fixes #1294
This commit is contained in:
Shivaram Lingamneni 2020-12-15 04:00:44 -05:00
parent 4d5815ab2e
commit fd71b79bb8
3 changed files with 76 additions and 19 deletions

View file

@ -4,6 +4,7 @@
package irc
import (
"sort"
"sync"
"github.com/oragono/oragono/irc/utils"
@ -405,3 +406,14 @@ func (cm *ChannelManager) Unpurge(chname string) (err error) {
}
return nil
}
func (cm *ChannelManager) ListPurged() (result []string) {
cm.RLock()
result = make([]string, 0, len(cm.purgedChannels))
for c := range cm.purgedChannels {
result = append(result, c)
}
cm.RUnlock()
sort.Strings(result)
return
}