comparison libervia/pages/forums/topics/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 6dfcdbeb0d33
comparison
equal deleted inserted replaced
1265:24e2973378f6 1266:6b7f9c3558cc
27 request.template_data.update({"service": service, "node": node}) 27 request.template_data.update({"service": service, "node": node})
28 template_data = request.template_data 28 template_data = request.template_data
29 topics, metadata = yield self.host.bridgeCall( 29 topics, metadata = yield self.host.bridgeCall(
30 "forumTopicsGet", service.full(), node, {}, profile 30 "forumTopicsGet", service.full(), node, {}, profile
31 ) 31 )
32 template_data["identities"] = identities = {} 32 identities = self.host.getSessionData(
33 request, session_iface.ISATSession
34 ).identities
33 for topic in topics: 35 for topic in topics:
34 parsed_uri = xmpp_uri.parseXMPPUri(topic["uri"]) 36 parsed_uri = xmpp_uri.parseXMPPUri(topic["uri"])
35 author = topic["author"] 37 author = topic["author"]
36 topic["http_uri"] = self.getPageByName("forum_view").getURL( 38 topic["http_uri"] = self.getPageByName("forum_view").getURL(
37 parsed_uri["path"], parsed_uri["node"] 39 parsed_uri["path"], parsed_uri["node"]