core (types): fix name conflict with xmlstream + docstring for is_local.

This commit is contained in:
Goffi 2026-04-04 00:48:19 +02:00
commit cba0e388b6

View file

@ -25,7 +25,7 @@ from twisted.python import failure
from typing_extensions import TypedDict
from twisted.words.protocols.jabber import jid as t_jid
from twisted.words.protocols.jabber import xmlstream
from twisted.words.protocols.jabber import xmlstream as mod_xmlstream
from twisted.words.xish import domish
from tx_xmpp import disco
@ -88,7 +88,7 @@ class SatXMPPEntity(ABC):
server_jid: t_jid.JID
port: int
identities: list[disco.DiscoIdentity]
xmlstream: xmlstream.XmlStream
xmlstream: mod_xmlstream.XmlStream
tor: "Tor | None" = None
def __init__(self) -> None:
@ -168,7 +168,7 @@ class SatXMPPEntity(ABC):
## sending ##
@abstractmethod
def IQ(self, type_="set", timeout=60) -> xmlstream.IQ:
def IQ(self, type_="set", timeout=60) -> mod_xmlstream.IQ:
"""shortcut to create an IQ element managing deferred
@param type_(unicode): IQ type ('set' or 'get')
@ -335,4 +335,6 @@ class SatXMPPClient(SatXMPPEntity):
class SatXMPPComponent(SatXMPPEntity):
def is_local(self, jid_: t_jid.JID) -> bool: ...
def is_local(self, jid_: t_jid.JID) -> bool:
"""Returns True if jid_ use a domain or subdomain of component's host"""
raise NotImplementedError