Mercurial > libervia-backend
comparison sat/plugins/plugin_xep_0077.py @ 3400:77ad87763f32
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.
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 12 Nov 2020 14:53:15 +0100 |
parents | aafb53248872 |
children | 8c25489bb79c |
comparison
equal
deleted
inserted
replaced
3399:506fa3d91d3a | 3400:77ad87763f32 |
---|---|
301 iq_elt = client.IQ() | 301 iq_elt = client.IQ() |
302 if to_jid is not None: | 302 if to_jid is not None: |
303 iq_elt["to"] = to_jid.full() | 303 iq_elt["to"] = to_jid.full() |
304 query_elt = iq_elt.addElement((NS_REG, "query")) | 304 query_elt = iq_elt.addElement((NS_REG, "query")) |
305 query_elt.addElement("remove") | 305 query_elt.addElement("remove") |
306 return iq_elt.send() | 306 d = iq_elt.send() |
307 if not to_jid or to_jid == jid.JID(client.jid.host): | |
308 d.addCallback(lambda __: client.entityDisconnect()) | |
309 return d | |
310 |