core (memory/disco): getInfos now handle node + use client instead of profile in many methods

This commit is contained in:
Goffi 2017-02-12 20:43:20 +01:00
commit 3bc851abf2

View file

@ -101,7 +101,7 @@ class XEP_0033(object):
self.sendAndStoreMessage(mess_data, entries, profile)
log.debug("XEP-0033 took over")
raise failure.Failure(exceptions.CancelError(u'Cancelled by XEP-0033'))
d = self.host.findFeaturesSet([NS_ADDRESS], profile=profile)
d = self.host.findFeaturesSet(client, [NS_ADDRESS])
d.addCallbacks(discoCallback, lambda dummy: discoCallback(None))
return d
@ -121,8 +121,8 @@ class XEP_0033(object):
- redesign the database to save only one entry to the database
- change the messageNew signal to eventually pass more than one recipient
"""
client = self.host.getClient(profile)
def send(mess_data, skip_send=False):
client = self.host.profiles[profile]
d = defer.Deferred()
if not skip_send:
d.addCallback(client.sendMessageData)
@ -156,7 +156,7 @@ class XEP_0033(object):
defer_list = []
for type_, jid_ in entries:
d = defer.Deferred()
d.addCallback(self.host.findFeaturesSet, jid_=JID(JID(jid_).host), profile=profile)
d.addCallback(self.host.findFeaturesSet, client=client, jid_=JID(JID(jid_).host))
d.addCallbacks(discoCallback, errback, callbackArgs=[jid_], errbackArgs=[jid_])
d.callback([NS_ADDRESS])
defer_list.append(d)