From c2788fea5034af290f01be89eb1a3af69a03c185 Mon Sep 17 00:00:00 2001 From: Goffi Date: Fri, 19 Jun 2020 15:37:02 +0200 Subject: [PATCH] plugin list of interest: new "interestRetract" method --- sat/plugins/plugin_exp_list_of_interest.py | 14 ++++++++++++++ sat/plugins/plugin_xep_0234.py | 1 - 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/sat/plugins/plugin_exp_list_of_interest.py b/sat/plugins/plugin_exp_list_of_interest.py index a0ee7761..a161b236 100644 --- a/sat/plugins/plugin_exp_list_of_interest.py +++ b/sat/plugins/plugin_exp_list_of_interest.py @@ -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): diff --git a/sat/plugins/plugin_xep_0234.py b/sat/plugins/plugin_xep_0234.py index f096b4ad..756e374a 100644 --- a/sat/plugins/plugin_xep_0234.py +++ b/sat/plugins/plugin_xep_0234.py @@ -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)