comparison src/plugins/plugin_xep_0277.py @ 1771:b77dc676a4df

tmp (wokkel/rsm): various improvments: - restored original tmp.wokkel.pubsub.PubSubService._toResponse_items - changed arguments order in RSMRequest.__init__ to have most common arguments first - added __str__ methods - better parsing/toElement - better handling of optional elements/attributes (count/index) - _toResponse_items handler RSM set elements without modifying original pubsub _toResponse_items - renamed parse to fromElement for coherency
author Goffi <goffi@goffi.org>
date Tue, 05 Jan 2016 23:20:20 +0100
parents d17772b0fe22
children 0876352459e5
comparison
equal deleted inserted replaced
1770:f525c272fd6d 1771:b77dc676a4df
526 log.warning(u"Can't create comments node for item {}".format(item_id)) 526 log.warning(u"Can't create comments node for item {}".format(item_id))
527 item = yield self.data2entry(data, item_id, profile) 527 item = yield self.data2entry(data, item_id, profile)
528 ret = yield self._p.publish(service, node, [item], profile_key=profile) 528 ret = yield self._p.publish(service, node, [item], profile_key=profile)
529 defer.returnValue(ret) 529 defer.returnValue(ret)
530 530
531
532 ## retract ## 531 ## retract ##
533 532
534 def _mbRetract(self, service_jid_s, nodeIdentifier, itemIdentifier, profile_key): 533 def _mbRetract(self, service_jid_s, nodeIdentifier, itemIdentifier, profile_key):
535 """Call self._p._retractItem, but use default node if node is empty""" 534 """Call self._p._retractItem, but use default node if node is empty"""
536 return self._p._retractItem(service_jid_s, nodeIdentifier or NS_MICROBLOG, itemIdentifier, True, profile_key) 535 return self._p._retractItem(service_jid_s, nodeIdentifier or NS_MICROBLOG, itemIdentifier, True, profile_key)
677 else: 676 else:
678 publishers = None 677 publishers = None
679 elif publishers_type == C.JID: 678 elif publishers_type == C.JID:
680 publishers[:] = [jid.JID(publisher) for publisher in publishers] 679 publishers[:] = [jid.JID(publisher) for publisher in publishers]
681 return publishers_type, publishers 680 return publishers_type, publishers
682
683
684 681
685 # subscribe # 682 # subscribe #
686 683
687 def _mbSubscribeToMany(self, publishers_type, publishers, profile_key): 684 def _mbSubscribeToMany(self, publishers_type, publishers, profile_key):
688 """ 685 """