Commit graph libervia-backend/sat/plugins/plugin_xep_0277.py
Author SHA1 Message Date
Goffi
3dd4a1e04f plugin XEP-0277: import SatXMPPEntity from core_types 2021-09-26 16:38:40 +02:00
Goffi
50d7cb2a51 merge bookmark @ 2021-09-08 11:20:37 +02:00
Goffi
dae3308751 plugin XEP-0277: use common.uri to parse comment URIs 2021-09-08 11:14:53 +02:00
Goffi
35bfb8b8b7 plugin XEP-0277: pubsub cache analyser implementation 2021-07-29 22:51:01 +02:00
Goffi
a7bae11831 plugin XEP-0277: ignore max_items if rsm_request is set 2021-07-29 21:28:48 +02:00
Goffi
f2a06bbcbf plugin XEP-0060: getItems extra is now serialised dict 2021-07-28 23:01:15 +02:00
Goffi
bab851006f plugin XEP-0060: getItem(s), publish and (un)subscribe are now coroutines 2021-06-30 16:19:14 +02:00
Goffi
510e3e9bdc plugin XEP-0277: "user" part of author jid is used for author name when later is missing 2021-06-06 22:06:28 +02:00
Goffi
93e4021b86 plugin XEP-0277: don't wrap DataError in failure.Failure in parseCommentUrl as it is not catched correctly:
`failure.Failure` is subclass of `BaseException` but not of `Exception`, as a result
`except Exception` doesn't catch it correctly. This is fixed by not wrapping `DataError`
in `failure.Failure` anymore.
2021-06-04 17:18:44 +02:00
Goffi
435027c1c9 plugin XEP-0060, XEP-0277: new rename methods (psItemRename, mbRename):
Those methods recreate an item to given new ID, and if successful, delete the former one.
2021-05-01 18:37:57 +02:00
Goffi
0af68b683a XEP-0277: new preview/mbPreview method:
This method does more or less the same thing as sending, but without actually sending the
item, and parse the generated element just after. This way, the triggers are run, and a
preview of the item can be made for the resulting microblog data.
2021-04-29 15:49:59 +02:00
Goffi
9df77100c4 plugin XEP-0277: user friendly ID:
when publishing a blog post without `id` specified, instead of using uuid, a user friendly
ID based on title or content is used. This allow to have better URLs in web frontend.

There is a (very low) risk of name collision if several articles with the same title or
content are published on the same pubsub node, user friendly ID can be deactivated by
using `user_friendly_id=False` in blog data to avoid that.
2021-04-16 18:33:00 +02:00
Goffi
a2e79b0c28 plugin XEP-0277: be sure to have an author_jid set 2021-03-27 14:59:50 +01:00
Goffi
69112bcd79 plugin XEP-0277: better resilience to broken items:
- if `author` element can't be found, `publisher` attribute, then `IQ`'s `from` attributes
  are used as fallback to find author jid
- fix categories (tags) parsing if `author` element is not found
- remove items which have failed parsing from `mbGet` results (instead of using `None`).
2021-03-27 14:38:27 +01:00
Goffi
dc86957043 date update 2021-03-19 15:45:14 +01:00
Goffi
8895c9c898 plugin XEP-0277: fixed item2mbdata call 2020-08-15 20:29:07 +02:00
Goffi
f2085455f7 plugin XEP-0277: set "uri" in item2mbdata 2020-08-03 08:45:49 +02:00
Goffi
e03eb5bfcc plugins XEP-0059, XEP-0060, XEP-0277, XEP-0313: better serialisation:
`data_format.serialise` is now used for `mbGet`, and RSM/MAM values are not transtyped to
strings anymore. A serialised dict is now used, items are put in the `items` key.

Comments handling has been refactored to use a list for the potentially multiple comments
nodes.

`rsm` data are now in a `rsm` key of the dict, and `mam` data are merged with other
metadata.
2020-07-16 09:07:20 +02:00
Goffi
a194874638 bridge: messageSend's extra is now serialised 2020-02-21 12:17:38 +01:00
Goffi
e1a44cf4e4 fixed shebangs 2020-01-29 10:07:00 +01:00
Goffi
a39349fe64 dates update 2020-01-29 09:50:54 +01:00
Goffi
9c84e5dcab plugin XEP-0277: fixed comments URLs parsing 2019-11-08 11:55:21 +01:00
Goffi
fbfe96c505 Python 3 port:
/!\ this is a huge commit
/!\ starting from this commit, SàT is needs Python 3.6+
/!\ SàT maybe be instable or some feature may not work anymore, this will improve with time

This patch port backend, bridge and frontends to Python 3.

Roughly this has been done this way:

- 2to3 tools has been applied (with python 3.7)
- all references to python2 have been replaced with python3 (notably shebangs)
- fixed files not handled by 2to3 (notably the shell script)
- several manual fixes
- fixed issues reported by Python 3 that where not handled in Python 2
- replaced "async" with "async_" when needed (it's a reserved word from Python 3.7)
- replaced zope's "implements" with @implementer decorator
- temporary hack to handle data pickled in database, as str or bytes may be returned,
  to be checked later
- fixed hash comparison for password
- removed some code which is not needed anymore with Python 3
- deactivated some code which needs to be checked (notably certificate validation)
- tested with jp, fixed reported issues until some basic commands worked
- ported Primitivus (after porting dependencies like urwid satext)
- more manual fixes
2019-08-13 19:08:41 +02:00
Goffi
6b83ef5c51 plugins: removed useless execute permission 2019-04-14 08:21:51 +02:00
Goffi
512ae0b91e plugin XEP-0277: blog items data are now entirely serialised before going to bridge:
So far, and for historical reasons, blog items data where serialised using a unicode: unicode dict, which was causing trouble for many types of values (timestamps, booleans, lists).
This patch changes it by serialising the whole items before going to bridge, and deserialising it when going back. This way, complex data can be used easily in items.
This impact psEvent and serItemsData* methods which are renamed transItemsData* because there are not always serialising anymore (a new argument "serialise" allows to specify it).
When editing a blog post in jp, metadata are now more easy to manipulate, specially lists like tags.
2019-02-23 18:59:00 +01:00
Goffi
f1c0eca9ab plugin text syntaxes: changed import name to TEXT_SYNTAX (better with underscore for autocompletion) 2019-01-19 11:39:02 +01:00
Goffi
8e338bf913 date update 2019-01-12 12:25:31 +01:00
Goffi
3e63d54e3d plugins XEP-0060, XEP-0313: implemented Order-By protoXEP:
new "order_by" key can be used in extra data, value can be, for now, "creation" or "modification".
2019-01-06 17:36:51 +01:00
Goffi
744cb0c503 code style reformatting using black 2018-06-27 20:14:46 +02:00
Goffi
80ef13612b core, setup: huge cleaning:
- moved directories from src and frontends/src to sat and sat_frontends, which is the recommanded naming convention
- move twisted directory to root
- removed all hacks from setup.py, and added missing dependencies, it is now clean
- use https URL for website in setup.py
- removed "Environment :: X11 Applications :: GTK", as wix is deprecated and removed
- renamed sat.sh to sat and fixed its installation
- added python_requires to specify Python version needed
- replaced glib2reactor which use deprecated code by gtk3reactor

sat can now be installed directly from virtualenv without using --system-site-packages anymore \o/
2018-04-02 19:44:50 +02:00
Renamed from src/plugins/plugin_xep_0277.py (Browse further)