Implement deduplicating channels
parent
a4dae2a583
commit
5cc38da00e
@ -0,0 +1,24 @@
|
|||||||
|
import main
|
||||||
|
from modules import chankeep
|
||||||
|
from modules import helpers
|
||||||
|
from json import dumps
|
||||||
|
|
||||||
|
class DedupCommand:
|
||||||
|
def __init__(self, *args):
|
||||||
|
self.dedup(*args)
|
||||||
|
|
||||||
|
def dedup(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length):
|
||||||
|
if authed:
|
||||||
|
if length == 1:
|
||||||
|
dupes = chankeep.getDuplicateChannels()
|
||||||
|
chankeep.partChannels(dupes)
|
||||||
|
info(dumps(dupes))
|
||||||
|
return
|
||||||
|
elif length == 2:
|
||||||
|
if spl[1] not in main.network.keys():
|
||||||
|
failure("No such network: %s" % spl[1])
|
||||||
|
return
|
||||||
|
dupes = chankeep.getDuplicateChannels(spl[1])
|
||||||
|
chankeep.partChannels(dupes)
|
||||||
|
info(dumps(dupes))
|
||||||
|
return
|
Loading…
Reference in New Issue