Fix various bugs uncovered by the LIST system
* Work around Twisted's broken handling of spaces * Work around Twisted's broken line decoding * Don't run signedOn twice for relays * Improved detection of whether the endpoint is connected to ZNC * Delay a LIST until all configured relays are online * Discard a LIST if there are no callbacks for it * Get rid of some double-negative ternary blocks
This commit is contained in:
@@ -12,7 +12,7 @@ def allRelaysActive(net):
|
||||
for i in main.network[net].relays.keys():
|
||||
name = net+str(i)
|
||||
if name in main.IRCPool.keys():
|
||||
if main.IRCPool[name].connected:
|
||||
if main.IRCPool[name].isconnected:
|
||||
existNum += 1
|
||||
if existNum == relayNum:
|
||||
return True
|
||||
@@ -28,7 +28,8 @@ def getChanFree(net, new):
|
||||
chanfree[i] = main.IRCPool[name].chanlimit-len(main.IRCPool[name].channels)
|
||||
chanlimits.add(main.IRCPool[name].chanlimit)
|
||||
if not len(chanlimits) == 1:
|
||||
error("Network %s has servers with different CHANMAX values" % net)
|
||||
error("Network %s has servers with different CHANLIMIT values" % net)
|
||||
print(chanlimits)
|
||||
return False
|
||||
return (chanfree, chanlimits.pop())
|
||||
|
||||
@@ -72,7 +73,7 @@ def notifyJoin(net):
|
||||
|
||||
def minifyChans(net, listinfo):
|
||||
if not allRelaysActive(net):
|
||||
error("All relays for %s are not active, cannot minify list")
|
||||
error("All relays for %s are not active, cannot minify list" % net)
|
||||
return False
|
||||
for i in main.network[net].relays.keys():
|
||||
name = net+str(i)
|
||||
|
||||
Reference in New Issue
Block a user