Commit graph libervia-backend/src/plugins/plugin_xep_0071.py
Author SHA1 Message Date
Goffi
93826f1ce8 core: sendMessageTrigger now manage pre and post treatments, which happen before or after XML generation 2014-03-22 15:34:05 +01:00
souliane
ff81f76184 plugin groupblog, XEP-0071, XEP-0277, text_syntaxes: manage raw/rich/xhtml data for content/title:
Implementation should follow the following formal specification:

"title" and "content" data can be passed in raw, xhtml or rich format.
When we receive from a frontend a new/updated microblog item:

- keys "title" or "content" have to be escaped (disable HTML tags)
- keys "title_rich" or "content_rich" have to be converted from the current syntax to XHTML
- keys "title_xhtml" or "content_xhtml" have to be cleaned from unwanted XHTML content

Rules to deal with concurrent keys:

- existence of both  "*_xhtml" and "*_rich" keys must raise an exception
- existence of both raw and ("*_xhtml" or "*_rich") is OK

As the storage always need raw data, if it is not given by the user it can be
extracted from the "*_rich" or "*_xhtml" data (remove the XHTML tags).

When a frontend wants to edit a blog post that contains XHTML title or content,
the conversion is made from XHTML to the current user-defined syntax.

- plugin text_syntaxes: added "text" syntax (using lxml)
2014-02-05 16:36:51 +01:00
Goffi
2ca6efd8cc dates update 2014-02-04 18:32:49 +01:00
Goffi
5a00dc9503 core: i18n refactoring:
- _() is no more installed in __builtin__
    - instead, there is a new sat.core.i18n module
    - added D_() method for deferred translation
    - languageSwitch method allow to dynamically change translation language
    - import gettext is tested against ImportError, and dummy methods are used when not available (mainly useful for Libervia)
2013-12-29 17:06:01 +01:00
Goffi
7fb9d0c309 plugin XEP-0071: rich messages management for sendMessage 2013-11-13 14:03:16 +01:00
Goffi
1769ca0492 plugin XEP-0071: XHTML2XHTML_IM don't return the <body> root tag anymore. 2013-11-13 14:02:02 +01:00
Goffi
008e449e59 plugin XEP_0071: first draft
a new "xhtml" key is added in bridge newMessage's extra data when rich text is found.
2013-11-05 22:41:45 +01:00