core (xmpp): send self-presence immediately after getting roster.

This commit is contained in:
Goffi 2026-05-03 10:26:43 +02:00
commit 5dced35020

View file

@ -245,7 +245,7 @@ class SatXMPPEntity(core_types.SatXMPPEntity):
def _create_sub_protocols(self):
return
def entity_connected(self):
def entity_connected(self) -> defer.Deferred[None] | None:
"""Called once connection is done
may return a Deferred, to perform initialisation tasks
@ -1157,13 +1157,13 @@ class SatXMPPClient(SatXMPPEntity, core_types.SatXMPPClient, tx_xmpp_client.XMPP
except exceptions.CancelError as e:
log.warning(f"start_connection cancelled: {e}")
return
entity = host.profiles[profile]
# we finally send our presence
entity.presence.available()
def entity_connected(self):
def entity_connected(self) -> defer.Deferred[None]:
# we want to be sure that we got the roster
return self.roster.got_roster
got_roster_d = self.roster.got_roster
# then send our presence.
self.presence.available()
return got_roster_d
def add_post_xml_callbacks(self, post_xml_treatments):
post_xml_treatments.addCallback(self.messageProt.complete_attachments)