Mercurial > libervia-web
comparison libervia/pages/blog/view/page_meta.py @ 1478:10ccad665d57
pages (blog/view): use rich content for comments
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 21 Oct 2021 17:37:59 +0200 |
parents | cff720e26089 |
children | 595e7fef41f3 |
comparison
equal
deleted
inserted
replaced
1477:b28025a7cc28 | 1478:10ccad665d57 |
---|---|
310 uri_args = {'path': service.full()} | 310 uri_args = {'path': service.full()} |
311 if node: | 311 if node: |
312 uri_args['node'] = node | 312 uri_args['node'] = node |
313 if item_id: | 313 if item_id: |
314 uri_args['item'] = item_id | 314 uri_args['item'] = item_id |
315 template_data['xmpp_uri'] = uri.buildXMPPUri('pubsub', subtype='microblog', **uri_args) | 315 template_data['xmpp_uri'] = uri.buildXMPPUri( |
316 'pubsub', subtype='microblog', **uri_args | |
317 ) | |
316 | 318 |
317 | 319 |
318 async def on_data_post(self, request): | 320 async def on_data_post(self, request): |
319 profile = self.getProfile(request) | 321 profile = self.getProfile(request) |
320 if profile is None: | 322 if profile is None: |
323 if type_ == 'comment': | 325 if type_ == 'comment': |
324 service, node, body = self.getPostedData(request, ('service', 'node', 'body')) | 326 service, node, body = self.getPostedData(request, ('service', 'node', 'body')) |
325 | 327 |
326 if not body: | 328 if not body: |
327 self.pageError(request, C.HTTP_BAD_REQUEST) | 329 self.pageError(request, C.HTTP_BAD_REQUEST) |
328 comment_data = {"content": body} | 330 comment_data = {"content_rich": body} |
329 try: | 331 try: |
330 await self.host.bridgeCall('mbSend', | 332 await self.host.bridgeCall('mbSend', |
331 service, | 333 service, |
332 node, | 334 node, |
333 data_format.serialise(comment_data), | 335 data_format.serialise(comment_data), |