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:
parent
4d5815ab2e
commit
fd71b79bb8
3 changed files with 76 additions and 19 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue