Mercurial > libervia-backend
comparison sat/plugins/plugin_exp_list_of_interest.py @ 3303:f17379123571
plugin list of interest: new "interestRetract" method
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 19 Jun 2020 15:37:02 +0200 |
parents | 83795ff8a633 |
children | 9a174abafdee |
comparison
equal
deleted
inserted
replaced
3302:9d61ceeaa847 | 3303:f17379123571 |
---|---|
65 "interestsRegisterFileSharing", | 65 "interestsRegisterFileSharing", |
66 ".plugin", | 66 ".plugin", |
67 in_sign="sssssss", | 67 in_sign="sssssss", |
68 out_sign="", | 68 out_sign="", |
69 method=self._registerFileSharing, | 69 method=self._registerFileSharing, |
70 async_=True, | |
71 ) | |
72 host.bridge.addMethod( | |
73 "interestRetract", | |
74 ".plugin", | |
75 in_sign="sss", | |
76 out_sign="", | |
77 method=self._interestRetract, | |
70 async_=True, | 78 async_=True, |
71 ) | 79 ) |
72 | 80 |
73 def getHandler(self, client): | 81 def getHandler(self, client): |
74 return ListInterestHandler(self) | 82 return ListInterestHandler(self) |
259 filtered_items.append(item) | 267 filtered_items.append(item) |
260 items = filtered_items | 268 items = filtered_items |
261 | 269 |
262 defer.returnValue((items, metadata)) | 270 defer.returnValue((items, metadata)) |
263 | 271 |
272 def _interestRetract(self, service_s, item_id, profile_key): | |
273 d = self._p._retractItem( | |
274 service_s, NS_LIST_INTEREST, item_id, True, profile_key) | |
275 d.addCallback(lambda __: None) | |
276 return d | |
277 | |
264 | 278 |
265 @implementer(iwokkel.IDisco) | 279 @implementer(iwokkel.IDisco) |
266 class ListInterestHandler(XMPPHandler): | 280 class ListInterestHandler(XMPPHandler): |
267 | 281 |
268 def __init__(self, plugin_parent): | 282 def __init__(self, plugin_parent): |