diff sat/plugins/plugin_exp_invitation.py @ 3350:cc6164a4973b

plugin list of interests: normalize item ID + added `get` method
author Goffi <goffi@goffi.org>
date Sat, 05 Sep 2020 20:22:23 +0200
parents b57b5e42e894
children 19bad15f4c0a
line wrap: on
line diff
--- a/sat/plugins/plugin_exp_invitation.py	Sat Sep 05 20:20:05 2020 +0200
+++ b/sat/plugins/plugin_exp_invitation.py	Sat Sep 05 20:22:23 2020 +0200
@@ -35,7 +35,7 @@
     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 @@
         """
         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