Mercurial > libervia-backend
diff sat/plugins/plugin_exp_invitation_file.py @ 3299:83795ff8a633
plugin list of interest: expose `interestsRegisterFileSharing` to bridge + use coroutines
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 09 Jun 2020 06:25:20 +0200 |
parents | 559a625a236b |
children | 5887fb414758 |
line wrap: on
line diff
--- a/sat/plugins/plugin_exp_invitation_file.py Tue Jun 09 06:23:37 2020 +0200 +++ b/sat/plugins/plugin_exp_invitation_file.py Tue Jun 09 06:25:20 2020 +0200 @@ -21,6 +21,7 @@ from sat.core.constants import Const as C from sat.core.log import getLogger from sat.tools.common import data_format +from twisted.internet import defer from twisted.words.protocols.jabber import jid log = getLogger(__name__) @@ -70,7 +71,7 @@ if repos_type == "files": type_human = _("file sharing") elif repos_type == "photos": - type_human = _("photos album") + type_human = _("photo album") else: log.warning("Unknown repository type: {repos_type}".format( repos_type=repos_type)) @@ -81,5 +82,8 @@ 'with namespace "{namespace}" at path [{path}]').format( profile=client.profile, type_human=type_human, namespace=namespace, path=path) ) - return self.host.plugins['LIST_INTEREST'].registerFileSharing( - client, service, repos_type, namespace, path, name, extra) + return defer.ensureDeferred( + self.host.plugins['LIST_INTEREST'].registerFileSharing( + client, service, repos_type, namespace, path, name, extra + ) + )