changeset 3303:f17379123571

plugin list of interest: new "interestRetract" method
author Goffi <goffi@goffi.org>
date Fri, 19 Jun 2020 15:37:02 +0200
parents 9d61ceeaa847
children 9a174abafdee
files sat/plugins/plugin_exp_list_of_interest.py sat/plugins/plugin_xep_0234.py
diffstat 2 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sat/plugins/plugin_exp_list_of_interest.py	Fri Jun 19 15:35:45 2020 +0200
+++ b/sat/plugins/plugin_exp_list_of_interest.py	Fri Jun 19 15:37:02 2020 +0200
@@ -69,6 +69,14 @@
             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 @@
 
         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):
--- a/sat/plugins/plugin_xep_0234.py	Fri Jun 19 15:35:45 2020 +0200
+++ b/sat/plugins/plugin_xep_0234.py	Fri Jun 19 15:37:02 2020 +0200
@@ -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)