plugin list of interest: new "interestRetract" method

This commit is contained in:
Goffi 2020-06-19 15:37:02 +02:00
commit c2788fea50
2 changed files with 14 additions and 1 deletions

View file

@ -69,6 +69,14 @@ class ListInterest(object):
method=self._registerFileSharing,
async_=True,
)
host.bridge.addMethod(
"interestRetract",
".plugin",
in_sign="sss",
out_sign="",
method=self._interestRetract,
async_=True,
)
def getHandler(self, client):
return ListInterestHandler(self)
@ -261,6 +269,12 @@ class ListInterest(object):
defer.returnValue((items, metadata))
def _interestRetract(self, service_s, item_id, profile_key):
d = self._p._retractItem(
service_s, NS_LIST_INTEREST, item_id, True, profile_key)
d.addCallback(lambda __: None)
return d
@implementer(iwokkel.IDisco)
class ListInterestHandler(XMPPHandler):

View file

@ -1,6 +1,5 @@
#!/usr/bin/env python3
# SAT plugin for Jingle File Transfer (XEP-0234)
# Copyright (C) 2009-2020 Jérôme Poisson (goffi@goffi.org)