core (main): renamed hasFeature to has_feature to fix inconsistency.

This commit is contained in:
Goffi 2025-09-05 19:31:50 +02:00
commit 0a42dd3da3
8 changed files with 8 additions and 8 deletions

View file

@ -1168,7 +1168,7 @@ class LiberviaBackend(service.Service):
# discovery methods are shortcuts to self.memory.disco
# the main difference with client.disco is that self.memory.disco manage cache
def hasFeature(self, *args, **kwargs):
def has_feature(self, *args, **kwargs):
return defer.ensureDeferred(self.memory.disco.has_feature(*args, **kwargs))
def check_feature(self, *args, **kwargs):

View file

@ -268,7 +268,7 @@ class IPPlugin(object):
return self._external_ip_cache
# we first try with XEP-0279
ip_check = await self.host.hasFeature(client, NS_IP_CHECK)
ip_check = await self.host.has_feature(client, NS_IP_CHECK)
if ip_check:
log.debug("Server IP Check available, we use it to retrieve our IP")
iq_elt = client.IQ("get")

View file

@ -1333,7 +1333,7 @@ class LiberviaMUCClient(muc.MUCClient):
async def join(self, room_jid, nick, password=None):
room_service = jid.JID(room_jid.host)
has_mam = await self.host.hasFeature(self.client, mam.NS_MAM, room_service)
has_mam = await self.host.has_feature(self.client, mam.NS_MAM, room_service)
if not self._mam or not has_mam:
return await self._join_legacy(self.client, room_jid, nick, password)
else:

View file

@ -75,7 +75,7 @@ class XEP_0096(object):
)
async def can_handle_file_send(self, client, peer_jid, filepath):
return await self.host.hasFeature(client, NS_SI_FT, peer_jid)
return await self.host.has_feature(client, NS_SI_FT, peer_jid)
def unload(self):
self._si.unregister_si_profile(SI_PROFILE_NAME)

View file

@ -68,7 +68,7 @@ class XEP_0115(object):
# because disco infos/identities may change between clients
# optimize check
client._caps_optimize = yield self.host.hasFeature(client, NS_CAPS_OPTIMIZE)
client._caps_optimize = yield self.host.has_feature(client, NS_CAPS_OPTIMIZE)
if client._caps_optimize:
log.info(_("Caps optimisation enabled"))
client._caps_sent = False

View file

@ -124,7 +124,7 @@ class XEP_0234(BaseApplicationHandler):
async def can_handle_file_send(self, client, peer_jid, filepath):
if peer_jid.resource:
return await self.host.hasFeature(client, NS_JINGLE_FT, peer_jid)
return await self.host.has_feature(client, NS_JINGLE_FT, peer_jid)
else:
# if we have a bare jid, Jingle Message Initiation will be tried
return True

View file

@ -538,7 +538,7 @@ class XEP_0260(BaseTransportHandler):
)
self._j.terminate(client, self._j.REASON_CONNECTIVITY_ERROR, session)
else:
d = self.host.hasFeature(
d = self.host.has_feature(
client, self._jingle_ibb.NAMESPACE, session["peer_jid"]
)
d.addCallback(self._do_fallback, session, content_name, client)

View file

@ -185,7 +185,7 @@ class XEP_0300:
"""
client = self.host.get_client(profile)
for algo in reversed(XEP_0300.ALGOS):
has_feature = await self.host.hasFeature(
has_feature = await self.host.has_feature(
client, NS_HASHES_FUNCTIONS.format(algo), to_jid
)
if has_feature: