Mercurial > libervia-backend
comparison src/plugins/plugin_xep_0277.py @ 1829:6079752ffeae
plugin XEP-0060, XEP-0277: added getNodeURI method
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 23 Jan 2016 19:53:16 +0100 |
parents | 1424cc6f8e98 |
children | 68c0dc13d821 |
comparison
equal
deleted
inserted
replaced
1828:cb4be663a4a7 | 1829:6079752ffeae |
---|---|
531 if not mb_data['comments']: | 531 if not mb_data['comments']: |
532 raise exceptions.DataError(u"if comments is present, it must not be empty") | 532 raise exceptions.DataError(u"if comments is present, it must not be empty") |
533 if 'comments_node' in mb_data or 'comments_service' in mb_data: | 533 if 'comments_node' in mb_data or 'comments_service' in mb_data: |
534 raise exceptions.DataError(u"You can't use comments_service/comments_node and comments at the same time") | 534 raise exceptions.DataError(u"You can't use comments_service/comments_node and comments at the same time") |
535 else: | 535 else: |
536 mb_data['comments'] = u"xmpp:%(service)s?%(query)s" % { | 536 mb_data['comments'] = self._p.getNodeURI(comments_service, comments_node) |
537 'service': comments_service.userhost(), | |
538 'query': urllib.urlencode([('node', comments_node.encode('utf-8'))]) | |
539 } | |
540 | 537 |
541 def _mbSend(self, service, node, data, profile_key): | 538 def _mbSend(self, service, node, data, profile_key): |
542 service = jid.JID(service) if service else None | 539 service = jid.JID(service) if service else None |
543 node = node if node else NS_MICROBLOG | 540 node = node if node else NS_MICROBLOG |
544 profile = self.host.memory.getProfileName(profile_key) | 541 profile = self.host.memory.getProfileName(profile_key) |