3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-24 11:42:51 +01:00

relay: only announce disconnects if the last connection was successful

This commit is contained in:
James Lu 2017-02-24 21:42:58 -08:00
parent b30d696e3a
commit cd65da75c6

View File

@ -1509,7 +1509,7 @@ def handle_disconnect(irc, numeric, command, args):
# Announce the disconnects to every leaf channel where the disconnected network is the owner
announcement = conf.conf.get('relay', {}).get('disconnect_announcement')
if announcement:
if announcement and args.get('was_successful'):
with db_lock:
for chanpair, entrydata in db.items():
if chanpair[0] == irc.name: