Mercurial > libervia-web
comparison libervia/pages/chat/page_meta.py @ 1266:6b7f9c3558cc
server, pages: better identities handling:
- own identity is now retrieve on connection
- use session identities all the time, fixed pages where an empty dict was used
- identities and own_jid are alway set in template_data for normal rendering
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 19 May 2020 11:02:32 +0200 |
parents | 8aff742d0dd0 |
children | 01936fc55cd9 |
comparison
equal
deleted
inserted
replaced
1265:24e2973378f6 | 1266:6b7f9c3558cc |
---|---|
82 True, | 82 True, |
83 {}, | 83 {}, |
84 profile, | 84 profile, |
85 ) | 85 ) |
86 authors = {m[2] for m in history} | 86 authors = {m[2] for m in history} |
87 identities = {} | 87 identities = session.identities |
88 for author in authors: | 88 for author in authors: |
89 id_raw = yield self.host.bridgeCall( | 89 id_raw = yield self.host.bridgeCall( |
90 "identityGet", author, [], True, profile) | 90 "identityGet", author, [], True, profile) |
91 identities[author] = data_format.deserialise(id_raw) | 91 identities[author] = data_format.deserialise(id_raw) |
92 | 92 |
93 template_data["messages"] = data_objects.Messages(history) | 93 template_data["messages"] = data_objects.Messages(history) |
94 rdata['identities'] = template_data["identities"] = identities | 94 rdata['identities'] = identities |
95 template_data["target_jid"] = target_jid | 95 template_data["target_jid"] = target_jid |
96 template_data["chat_type"] = chat_type | 96 template_data["chat_type"] = chat_type |
97 | 97 |
98 | 98 |
99 def on_data(self, request, data): | 99 def on_data(self, request, data): |