Implement updating registration via API
This commit is contained in:
@@ -120,6 +120,29 @@ def enableAuthentication(net, num):
|
||||
confirmRegistration(net, num)
|
||||
|
||||
|
||||
def get_unregistered_relays(net=None):
|
||||
"""
|
||||
Get a dict of unregistereed relays, either globally or
|
||||
for a network.
|
||||
Returns:
|
||||
{"net": [["nick1", 1], ["nick2", 2], ...]}
|
||||
"""
|
||||
unreg = {}
|
||||
if net:
|
||||
nets = [net]
|
||||
else:
|
||||
nets = main.network.keys()
|
||||
for i in nets:
|
||||
for num in main.network[i].relays.keys():
|
||||
if not main.network[i].relays[num]["registered"]:
|
||||
nick = main.alias[num]["nick"]
|
||||
if net in unreg:
|
||||
unreg[i].append([nick, num])
|
||||
else:
|
||||
unreg[i] = [[nick, num]]
|
||||
return unreg
|
||||
|
||||
|
||||
def registerTest(c):
|
||||
sinst = substitute(c["net"], c["num"])
|
||||
name = c["net"] + str(c["num"])
|
||||
|
||||
Reference in New Issue
Block a user