Relaynext: fix check for disconnected networks

This commit is contained in:
James Lu 2015-12-27 13:58:36 -08:00
parent 7af92f86a5
commit a08eb2dc4a

View File

@ -249,12 +249,14 @@ class RelayNext(callbacks.Plugin):
for cn in targets:
target, net = cn.split("@")
otherIrc = world.getIrc(net)
target_chanobj = otherIrc.state.channels.get(target)
if otherIrc is None:
self.log.debug("RelayNext: message to network %r"
" dropped, we are not connected "
"there!", net)
elif (not target_chanobj) or otherIrc.nick not in target_chanobj.users:
return
target_chanobj = otherIrc.state.channels.get(target)
if (not target_chanobj) or otherIrc.nick not in target_chanobj.users:
# We're not in the target relay channel!
self.log.debug("RelayNext: message to %s@%s "
"dropped, we are not in that "