# HG changeset patch # User Goffi # Date 1605189195 -3600 # Node ID 77ad87763f32706fed1409c7abf1375865f83658 # Parent 506fa3d91d3a16edf8cbd1fccd9f5cf0338236a4 plugin XEP-0077: disconnect client when deleting self account: where profile's XMPP account is deleted, its client must be explicitely disconnected to avoid automatic reconnection, which would obviously fail. diff -r 506fa3d91d3a -r 77ad87763f32 sat/plugins/plugin_xep_0077.py --- a/sat/plugins/plugin_xep_0077.py Thu Nov 12 14:53:15 2020 +0100 +++ b/sat/plugins/plugin_xep_0077.py Thu Nov 12 14:53:15 2020 +0100 @@ -303,4 +303,8 @@ iq_elt["to"] = to_jid.full() query_elt = iq_elt.addElement((NS_REG, "query")) query_elt.addElement("remove") - return iq_elt.send() + d = iq_elt.send() + if not to_jid or to_jid == jid.JID(client.jid.host): + d.addCallback(lambda __: client.entityDisconnect()) + return d +