Commit graph libervia-backend/sat/plugins/plugin_xep_0060.py
Author SHA1 Message Date
Goffi
abbd14484b plugin XEP-0060: fixed payload parsing in sendItem 2020-05-18 23:38:21 +02:00
Goffi
d1abda6ddb plugin XEP-0060: async sendItems + precondition-not-met policy:
- sendItems is now an "async" coroutine, and sendItem use it instead of duplicating
  publication logic
- policy to use when a precondition is not met (with publish-options) can now be
  specified, for now it's either raise the exception (default policy), or try to publish
  without the options
- constants have been added to handle "extra" keys
2020-03-11 19:15:48 +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
b7a74d5034 plugin XEP-0060, jp (pubsub/set): publish-options implementation:
- publishing options (XEP-0060 §7.1.5) implementation.
- jp pubsub/set can specify publish-options using `-f` and `-F`
- doc has been updated to explain that
- psItemSend and psItemsSend now use serialisation for "extra"
- publish-options can be specified in extra['publish-options'] with those methods
2019-12-28 20:02:18 +01:00
Goffi
9c84e5dcab plugin XEP-0277: fixed comments URLs parsing 2019-11-08 11:55:21 +01:00
Goffi
7e92cb1b1c plugin XEP-0060: fixed bad MAM unwrapping after Python 3 port 2019-10-20 19:34:26 +02: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
1ccb54e571 tools (sat_defer), plugin XEP-0060: added a function "stanza2NotFound" to convert item-not-found StanzaError to exceptions.NotFound in an errback 2019-04-14 08:21:51 +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
fc3598e660 plugin XEP-0060: added purgeNode/psNodePurge method to remove all items from a node 2019-02-15 22:13:43 +01:00
Goffi
d1e3821e5a plugin XEP-0060: added sendItems/psItemsSend method to publish several items at once 2019-02-15 22:13:20 +01:00
Goffi
7e9ebc84a7 plugin pubsub admin: pubsub administrator first draft:
This experimental protocol allows to publish items where publishers can be specified.
2019-01-15 08:51:54 +01:00
Goffi
8e338bf913 date update 2019-01-12 12:25:31 +01:00
Goffi
173e192526 plugin XEP-0060: set a 30s timeout on items get 2019-01-11 19:49:01 +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
9dd628d1ed plugin XEP-0060: fixed MAM return value on getItems():
callback to generate metadata was using wrong items in return argument.
2019-01-06 17:33:53 +01:00
Goffi
c77bc72490 plugin XEP-0313, XEP-0045: loop MAM requests until whole archive is retrieved:
- plugin xep-0313: new serialise method
-                : getArchives now returns an extra mam_response dict with "complete" and "stable" status
-                : MAMGet now return a new metadata dict before profile (with serialised RSM and MAM response)
2018-12-10 20:34:45 +01:00
Goffi
8e27547531 plugin XEP-0060: use new parseExtra methods from MAM and RSM 2018-12-01 10:34:42 +01:00
Goffi
34f3a2e949 plugin XEP-0060: added singleton ID ("current") 2018-07-29 19:23:01 +02:00
Goffi
ff79fa3ce0 core: style improvments (90 chars limit) 2018-07-29 18:44:27 +02: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_0060.py (Browse further)