comparison src/pages/g/e/page_meta.py @ 942:6b55d038b121

pages (g/e): adapted event handling to changes in backend
author Goffi <goffi@goffi.org>
date Fri, 19 May 2017 12:57:53 +0200
parents e30a4b7eff09
children aacda981c348
comparison
equal deleted inserted replaced
941:aba7208d9d50 942:6b55d038b121
33 if event_uri_data[u'type'] != u'pubsub': 33 if event_uri_data[u'type'] != u'pubsub':
34 self.pageError(request, C.HTTP_SERVICE_UNAVAILABLE) 34 self.pageError(request, C.HTTP_SERVICE_UNAVAILABLE)
35 35
36 event_service = template_data[u'event_service'] = jid.JID(event_uri_data[u'path']) 36 event_service = template_data[u'event_service'] = jid.JID(event_uri_data[u'path'])
37 event_node = template_data[u'event_node'] = event_uri_data[u'node'] 37 event_node = template_data[u'event_node'] = event_uri_data[u'node']
38 event_id = template_data[u'event_id'] = event_uri_data.get(u'item','')
38 profile = self.getProfile(request) 39 profile = self.getProfile(request)
39 event_data = yield self.host.bridgeCall(u"eventGet", event_service.userhost(), event_node, profile) 40 event_timestamp, event_data = yield self.host.bridgeCall(u"eventGet", event_service.userhost(), event_node, event_id, profile)
41 try:
42 background_image = event_data.pop('background-image')
43 except KeyError:
44 pass
45 else:
46 template_data['background_image'] = background_image
40 template_data['event'] = event_data 47 template_data['event'] = event_data
48 event_invitee_data = yield self.host.bridgeCall(
49 u"eventInviteeGet",
50 event_data['invitees_service'],
51 event_data['invitees_node'],
52 profile)
53 template_data['invitee'] = event_invitee_data
41 54
42 ## Blog ## 55 ## Blog ##
43 56
44 main_uri_data = uri.parseXMPPUri(main_uri) 57 main_uri_data = uri.parseXMPPUri(main_uri)
45 if main_uri_data[u'type'] != u'pubsub' or main_uri_data.get('sub_type') != 'microblog': 58 if main_uri_data[u'type'] != u'pubsub' or main_uri_data.get('sub_type') != 'microblog':
62 elif type_ == u'attendance': 75 elif type_ == u'attendance':
63 profile = self.getProfile(request) 76 profile = self.getProfile(request)
64 service, node, attend, guests = self.getPostedData(request, (u'service', u'node', u'attend', u'guests')) 77 service, node, attend, guests = self.getPostedData(request, (u'service', u'node', u'attend', u'guests'))
65 data = {u'attend': attend, 78 data = {u'attend': attend,
66 u'guests': guests} 79 u'guests': guests}
67 yield self.host.bridgeCall(u"eventSet", service, node, data, profile) 80 yield self.host.bridgeCall(u"eventInviteeSet", service, node, data, profile)
68 else: 81 else:
69 log.warning(_(u"Unhandled data type: {}").format(type_)) 82 log.warning(_(u"Unhandled data type: {}").format(type_))