plugin list of interests: normalize item ID + added get method

This commit is contained in:
Goffi 2020-09-05 20:22:23 +02:00
commit 6f139b80e1

View file

@ -35,7 +35,7 @@ PLUGIN_INFO = {
C.PI_IMPORT_NAME: "INVITATION",
C.PI_TYPE: "EXP",
C.PI_PROTOCOLS: [],
C.PI_DEPENDENCIES: ["XEP-0060", "XEP-0106", "XEP-0329"],
C.PI_DEPENDENCIES: ["XEP-0060", "XEP-0329", "LIST_INTEREST"],
C.PI_RECOMMENDATIONS: ["EMAIL_INVITATION"],
C.PI_MAIN: "Invitation",
C.PI_HANDLER: "yes",
@ -163,12 +163,8 @@ class Invitation(object):
"""
if extra is None:
extra = {}
# FIXME: Q&D fix as the bare file sharing service JID will lead to user own
# repository, which thus would not be the same for the host and the guest.
# By specifying the user part, we for the use of the host repository.
# A cleaner way should be implemented
if service.user is None:
service.user = self.host.plugins['XEP-0106'].escape(client.jid.user)
li_plg = self.host.plugins["LIST_INTEREST"]
li_plg.normaliseFileSharingService(client, service)
# FIXME: not the best place to adapt permission, but it's necessary to check them
# for UX