comparison src/plugins/plugin_xep_0277.py @ 1728:0eaa1a409dfb

plugin XEP-0277, EXTRA-PEP: get massive blogs from all the roster also retrieve items from a special JIDs list defined in EXTRA-PEP
author souliane <souliane@mailoo.org>
date Tue, 08 Dec 2015 17:41:34 +0100
parents 96b722a5e263
children cf11cfc87ef9
comparison
equal deleted inserted replaced
1727:68e498b3367e 1728:0eaa1a409dfb
52 "name": "Microblogging over XMPP Plugin", 52 "name": "Microblogging over XMPP Plugin",
53 "import_name": "XEP-0277", 53 "import_name": "XEP-0277",
54 "type": "XEP", 54 "type": "XEP",
55 "protocols": ["XEP-0277"], 55 "protocols": ["XEP-0277"],
56 "dependencies": ["XEP-0163", "XEP-0060", "TEXT-SYNTAXES"], 56 "dependencies": ["XEP-0163", "XEP-0060", "TEXT-SYNTAXES"],
57 "recommendations": ["XEP-0059"], 57 "recommendations": ["XEP-0059", "EXTRA-PEP"],
58 "main": "XEP_0277", 58 "main": "XEP_0277",
59 "handler": "no", 59 "handler": "no",
60 "description": _("""Implementation of microblogging Protocol""") 60 "description": _("""Implementation of microblogging Protocol""")
61 } 61 }
62 62
645 client = self.host.getClient(profile_key) 645 client = self.host.getClient(profile_key)
646 if publishers_type == C.JID: 646 if publishers_type == C.JID:
647 jids_set = set(publishers) 647 jids_set = set(publishers)
648 else: 648 else:
649 jids_set = client.roster.getJidsSet(publishers_type, publishers) 649 jids_set = client.roster.getJidsSet(publishers_type, publishers)
650 if publishers_type == C.ALL:
651 try: # display messages from salut-a-toi@libervia.org or other PEP services
652 services = self.host.plugins["EXTRA-PEP"].getConfig("get_items_from_list")
653 except KeyError:
654 pass
655 else:
656 log.debug("Items from the following extra PEP services will be requested as well: %s" % ", ".join(services))
657 jids_set.update([jid.JID(service) for service in services])
650 658
651 node_data = [] 659 node_data = []
652 for jid_ in jids_set: 660 for jid_ in jids_set:
653 node_data.append((jid_, NS_MICROBLOG)) 661 node_data.append((jid_, NS_MICROBLOG))
654 return client, node_data 662 return client, node_data