# HG changeset patch # User Goffi # Date 1599335960 -7200 # Node ID a32f3f47e4a8636fa6765a2acf746624c7f7e57f # Parent 886d1856e9de3157bb1c4bb9871cafd033744151 server (restricted_bridge): added `interestsRegisterFileSharing` + filter extra_s in `FISInvite` diff -r 886d1856e9de -r a32f3f47e4a8 libervia/server/restricted_bridge.py --- a/libervia/server/restricted_bridge.py Sat Sep 05 21:59:17 2020 +0200 +++ b/libervia/server/restricted_bridge.py Sat Sep 05 21:59:20 2020 +0200 @@ -17,6 +17,7 @@ # along with this program. If not, see . from libervia.server.constants import Const as C +from sat.tools.common import data_format class RestrictedBridge: @@ -56,6 +57,22 @@ return await self.host.bridgeCall( "fileSharingDelete", service_jid, path, namespace, profile) + async def interestsRegisterFileSharing( + self, service, repos_type, namespace, path, name, extra_s, profile + ): + if extra_s: + # we only allow "thumb_url" here + extra = data_format.deserialise(extra_s) + if "thumb_url" in extra: + extra_s = data_format.serialise({"thumb_url": extra["thumb_url"]}) + else: + extra_s = "" + + return await self.host.bridgeCall( + "interestsRegisterFileSharing", service, repos_type, namespace, path, name, + extra_s, profile + ) + async def interestRetract( self, service_jid, item_id, profile ): @@ -66,6 +83,14 @@ self, invitee_jid_s, service_s, repos_type, namespace, path, name, extra_s, profile ): + if extra_s: + # we only allow "thumb_url" here + extra = data_format.deserialise(extra_s) + if "thumb_url" in extra: + extra_s = data_format.serialise({"thumb_url": extra["thumb_url"]}) + else: + extra_s = "" + return await self.host.bridgeCall( "FISInvite", invitee_jid_s, service_s, repos_type, namespace, path, name, extra_s, profile