Mercurial > libervia-backend
comparison libervia/backend/memory/disco.py @ 4342:17fa953c8cd7
core (types): improve `SatXMPPEntity` core type and type hints.
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 13 Jan 2025 01:23:10 +0100 |
parents | e9971a4b0627 |
children |
comparison
equal
deleted
inserted
replaced
4341:e9971a4b0627 | 4342:17fa953c8cd7 |
---|---|
202 @return: True if the entity has the given identity | 202 @return: True if the entity has the given identity |
203 """ | 203 """ |
204 disco_infos = await self.get_infos(client, jid_, node) | 204 disco_infos = await self.get_infos(client, jid_, node) |
205 return (category, type_) in disco_infos.identities | 205 return (category, type_) in disco_infos.identities |
206 | 206 |
207 def get_infos(self, client, jid_=None, node="", use_cache=True): | 207 def get_infos( |
208 self, | |
209 client: SatXMPPEntity, | |
210 jid_: jid.JID|None=None, | |
211 node: str="", | |
212 use_cache: bool=True | |
213 ) -> defer.Deferred[disco.DiscoInfo]: | |
208 """get disco infos from jid_, filling capability hash if needed | 214 """get disco infos from jid_, filling capability hash if needed |
209 | 215 |
210 @param jid_: jid of the target, or None for profile's server | 216 @param jid_: jid of the target, or None for profile's server |
211 @param node(unicode): optional node to use for disco request | 217 @param node: optional node to use for disco request |
212 @param use_cache(bool): if True, use cached data if available | 218 @param use_cache: if True, use cached data if available |
213 @return: a Deferred which fire disco.DiscoInfo | 219 @return: a Deferred which fire disco.DiscoInfo |
214 """ | 220 """ |
215 if jid_ is None: | 221 if jid_ is None: |
216 jid_ = jid.JID(client.jid.host) | 222 jid_ = jid.JID(client.jid.host) |
217 try: | 223 try: |