Mercurial > libervia-web
comparison libervia/pages/blog/page_meta.py @ 1243:8aff742d0dd0
pages: updated `identityGet` call, following backend changes
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 19 Apr 2020 22:56:59 +0200 |
parents | f511f8fbbf8a |
children | 6b7f9c3558cc |
comparison
equal
deleted
inserted
replaced
1242:8f39d98416c5 | 1243:8aff742d0dd0 |
---|---|
3 from sat.core.i18n import _ | 3 from sat.core.i18n import _ |
4 from libervia.server.constants import Const as C | 4 from libervia.server.constants import Const as C |
5 from twisted.words.protocols.jabber import jid | 5 from twisted.words.protocols.jabber import jid |
6 from twisted.internet import defer | 6 from twisted.internet import defer |
7 from libervia.server import session_iface | 7 from libervia.server import session_iface |
8 from sat.tools.common import data_format | |
8 from sat.core.log import getLogger | 9 from sat.core.log import getLogger |
9 | 10 |
10 log = getLogger(__name__) | 11 log = getLogger(__name__) |
11 | 12 |
12 name = "blog" | 13 name = "blog" |
43 entity_jid_s | 44 entity_jid_s |
44 ) | 45 ) |
45 if entity_jid_s not in identities: | 46 if entity_jid_s not in identities: |
46 d_list.append(self.host.bridgeCall("identityGet", | 47 d_list.append(self.host.bridgeCall("identityGet", |
47 entity_jid_s, | 48 entity_jid_s, |
49 [], | |
50 True, | |
48 profile)) | 51 profile)) |
49 identities_data = yield defer.DeferredList(d_list) | 52 identities_data = yield defer.DeferredList(d_list) |
50 for idx, (success, identity) in enumerate(identities_data): | 53 for idx, (success, identity_raw) in enumerate(identities_data): |
51 entity_jid_s = entities[idx] | 54 entity_jid_s = entities[idx] |
52 if not success: | 55 if not success: |
53 log.warning(_("Can't retrieve identity of {entity}") | 56 log.warning(_("Can't retrieve identity of {entity}") |
54 .format(entity=entity_jid_s)) | 57 .format(entity=entity_jid_s)) |
55 else: | 58 else: |
56 identities[entity_jid_s] = identity | 59 identities[entity_jid_s] = data_format.deserialise(identity_raw) |
57 | 60 |
58 | 61 |
59 def on_data_post(self, request): | 62 def on_data_post(self, request): |
60 jid_str = self.getPostedData(request, "jid") | 63 jid_str = self.getPostedData(request, "jid") |
61 try: | 64 try: |