plugins invitation*, events: added an extra parameter and use it to keep a thumnail URL

This commit is contained in:
Goffi 2019-05-03 13:05:01 +02:00
commit d3e86f4ba2

View file

@ -20,6 +20,7 @@
from sat.core.i18n import _
from sat.core.constants import Const as C
from sat.core.log import getLogger
from sat.tools.common import data_format
from twisted.words.protocols.jabber import jid
log = getLogger(__name__)
@ -48,22 +49,24 @@ class FileSharingInvitation(object):
host.bridge.addMethod(
"FISInvite",
".plugin",
in_sign="sssssss",
in_sign="ssssssss",
out_sign="",
method=self._sendFileSharingInvitation,
)
def _sendFileSharingInvitation(
self, invitee_jid_s, service_s, repos_type=None, namespace=None, path=None,
name=None, profile_key=C.PROF_KEY_NONE):
name=None, extra_s=u'', profile_key=C.PROF_KEY_NONE):
client = self.host.getClient(profile_key)
invitee_jid = jid.JID(invitee_jid_s)
service = jid.JID(service_s)
extra = data_format.deserialise(extra_s)
return self.host.plugins[u"INVITATION"].sendFileSharingInvitation(
client, invitee_jid, service, repos_type=None, namespace=None, path=None,
name=None)
client, invitee_jid, service, repos_type=repos_type or None,
namespace=namespace or None, path=path or None, name=name or None,
extra=extra)
def onInvitation(self, client, service, repos_type, namespace, path, name):
def onInvitation(self, client, name, extra, service, repos_type, namespace, path):
if repos_type == u"files":
type_human = _(u"file sharing")
elif repos_type == u"photos":
@ -79,4 +82,4 @@ class FileSharingInvitation(object):
profile=client.profile, type_human=type_human, namespace=namespace, path=path)
)
return self.host.plugins[u'LIST_INTEREST'].registerFileSharing(
client, service, repos_type, namespace, path, name)
client, service, repos_type, namespace, path, name, extra)