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
16 changed files with 69 additions and 60 deletions

View file

@ -211,12 +211,13 @@ class FilePlugin(object):
@param profile: %(doc_profile)s
@return (dict): action dictionary, with progress id in case of success, else xmlui message
"""
client = self.host.getClient(profile)
if not os.path.isfile(filepath):
raise exceptions.DataError(u"The given path doesn't link to a file")
if not filename:
filename = os.path.basename(filepath) or '_'
for namespace, callback, priority, method_name in self._file_callbacks:
has_feature = yield self.host.hasFeature(namespace, peer_jid, profile)
has_feature = yield self.host.hasFeature(client, namespace, peer_jid)
if has_feature:
log.info(u"{name} method will be used to send the file".format(name=method_name))
progress_id = yield callback(peer_jid, filepath, filename, file_desc, profile)