Commit graph libervia-backend/sat/plugins
Author SHA1 Message Date
Goffi
f065ba4ff6 plugin XEP-0045: join / MAM history improvements:
- fixed use of history_d deferred so MAM history is stored in database as soon as possible
  and in right order
- get MAM history with pages of 20 messages instead of 100
- if a message can't be parsed, an error message is logged (with a dump of the stanza),
  and the message is ignored, avoiding a crash and the impossibility the join the room at
  all
- a new `mucRoomPrepareJoin` signal, containing room jid and profile, is sent when a room
  joining is started, this allow better UX as the frontend can show the room immediately,
  and lock it with a waiting message until it is fully available. The `mucRoomJoined` is
  still sent when the room is fully joined/avaiable, meaning that the frontend can unlock
  it and let the user interact with it
2019-10-18 14:45:07 +02:00
Goffi
73a4f8d8f6 plugin OTR: work around a bad exception raised in potr 2019-10-16 08:39:52 +02:00
Goffi
5bfb675a29 plugin android: fixed encoding in states after Python 3 port 2019-10-16 08:39:52 +02:00
Goffi
995b777393 plugin account: fixed email sending 2019-10-11 16:15:34 +02:00
Goffi
76aadbb3fb jp: jp asyncio port:
/!\ this commit is huge. Jp is temporarily not working with `dbus` bridge /!\

This patch implements the port of jp to asyncio, so it is now correctly using the bridge
asynchronously, and it can be used with bridges like `pb`. This also simplify the code,
notably for things which were previously implemented with many callbacks (like pagination
with RSM).

During the process, some behaviours have been modified/fixed, in jp and backends, check
diff for details.
2019-09-25 08:56:41 +02:00
Goffi
b00ea1546c plugin XEP-0329: fixed ShareNode item() and values after Python 3 port 2019-08-16 17:06:44 +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
633e1eb203 plugin XEP-0313: log issues in addToHistory instead of raising error 2019-07-24 07:51:48 +02:00
Goffi
200ee13a97 plugin XEP-0198: don't crash if transport is None in onAckTimeOut 2019-07-21 10:16:32 +02:00
Goffi
5e051ddb20 plugin XEP-0198: catch and log an error if buffer is unexpectedly empty 2019-07-20 20:55:17 +02:00
Goffi
303f82d012 plugin android: catch and log exception when using the vibrator:
vibrator is currently not working with plyer, this patch avoid a crash and log the issue.

rel 332
2019-07-20 20:53:52 +02:00
Goffi
adc5204b1a plugin XEP-0045: fixed a bad attribute in a log message. 2019-07-19 23:01:57 +02:00
Goffi
9487b0534b plugin ad-hoc D-Bus: fixed warning when no media player is found 2019-07-19 17:07:56 +02:00
Goffi
6f5718a045 plugin XEP-0198: retrieve missing messages + send buffered ones on hot reconnection:
Missing one2one messages are now retrieved with MAM on hot reconnection, and buffered ones
(which have most probably not been received by the server) are resent at the end of the
reconnection workflow. IQ results are not re-sent on hot reconnection, as they don't make
sense anymore with a new session.

fix 330
2019-07-17 09:28:35 +02:00
Goffi
a6b9873462 plugin adhoc D-Bus: typo 2019-07-17 09:28:33 +02:00
Goffi
9e2a35f6e5 plugins XEP-0045, XEP-0198: rejoin MUC rooms while a hot reconnection is done:
when resuming is not possible with stream management, a hot reconnection is done
(reconnecting without restarting every plugin). This was causing trouble for joined MUC
rooms, which were not accessible anymore (because they were not re-joined).
This patch fixes it by clearing rooms first (to avoid considering the room joined and
broadcasting the initial presence to them), then re-joining them.

fix 322
2019-07-16 21:59:30 +02:00
Goffi
cb85f61fe4 plugins account, email invitation: fixed import of "email" module after it has been moved 2019-07-15 22:36:28 +02:00
Goffi
4743b1c840 plugin XEP-0054: reject image without MIME type if it's not PNG 2019-07-14 16:43:04 +02:00
Goffi
692a5b34fc plugin 0249: fixed invitation handling + some improvments:
- properly retrieve payload by namespace
- now use a trigger instead of observer, so the message workflow is stopped if an invitation is found
- namespace is registered

fix 241
2019-07-14 11:23:25 +02:00
Goffi
5e43c6c98c core, plugin XEP-0045: fixed message type autodetection + ENTITY_TYPE_MUC constant:
an old hardcoded value was used in several places to detect if an entity is a MUC, but this
value was not valid anymore. This has been fixed, and ENTITY_TYPE_MUC constant is now used
instead. This fixes message type autodetection for "groupchat" messages.

fixes 300
2019-07-09 09:06:45 +02:00
Goffi
eb08ab4927 plugin XEP-0045: avoid sending useless presence signals:
- presence signals were sent twice (from XEP-0045 itself + core), this is now avoided by
  cancelling presence workflow in core when presence if from a joined room.
- filter out cached presences if no status or show information is set (occupants are
  already specified in mucRoomJoined signal)
2019-07-07 15:39:53 +02:00
Goffi
c857c375fc plugin XEP-0045: log "failure" on configure error 2019-07-06 15:51:48 +02:00
Goffi
fa50789710 quick_frontend (contact list): fixed nick use for groupchat:
during the profile connection workflow, joined rooms are retrieved, then presence are
filled, all asynchronously. In some cases, all rooms may not be joined when presence are
filled, resulting in cache being already filled with a `nick` when cache is set for the
room itself. Because of that, a `nick` may be displayed in contact list instead of MUC local
part. This patch fixes it by removing `nick` if it exists when cache a MUC room.

fix 305
2019-07-05 15:58:15 +02:00
Goffi
b8a858d639 plugin XEP-0045: added a warning if a message is discarded because the room has not been found 2019-07-02 19:36:27 +02:00
Goffi
c226b72b20 core, plugin XEP-0045: fix crashes when changing URIs:
When adding missing URIs in message, the "children" property was used instead of elements(). "children" not only return elements, and this was causing crashes.
This may fix bug 294

rel 294
2019-06-30 15:52:30 +02:00
Goffi
481ce4c379 plugins schema, tickets, merge_requests: use serialised data for extra dict + some cosmetic changes 2019-06-14 12:37:34 +02:00
Goffi
0f97a75f6f tools (xml_tools): added "read_only" argument in dataFormResult2XMLUI (and use it in plugin pubsub_schema) 2019-06-12 09:11:28 +02:00
Goffi
ff1a025650 plugin events: fixed invitation + set name and thumb_url from event element 2019-05-04 00:06:41 +02:00
Goffi
56c14723df plugin list interest: initialise extra with an empty dict if not set in registerPubsub 2019-05-04 00:05:11 +02:00
Goffi
432afa025e plugin XEP-0329: correctly handle error if something is wrong when getting file from component. 2019-05-03 20:46:59 +02:00
Goffi
39d941ddcf plugin list interests: add "namespace" in serialised data 2019-05-03 20:44:55 +02:00
Goffi
bd54aec282 plugin events: register namespace using "event" short name 2019-05-03 20:42:21 +02:00
Goffi
b2e22c6af8 plugin file sharing management: filter out empty values in allowed_jids 2019-05-03 20:41:28 +02:00
Goffi
8a513c4829 plugin list of interest: added an interestsList bridge method + handle thumb_url 2019-05-03 13:06:47 +02:00
Goffi
d3e86f4ba2 plugins invitation*, events: added an extra parameter and use it to keep a thumnail URL 2019-05-03 13:05:01 +02:00
Goffi
2dfae32542 plugin XEP-0313: fixed archive retrieval on connection:
last stanza-id is now saved for every message received, and not only retrieved from local message history anymore.
If we are the sender of a message from archive, it is only added to local history, else it is injected to normal workflow.
2019-05-03 13:00:08 +02:00
Goffi
1dd3518943 plugin comp file sharing: file sharing management first draft:
the new "component file sharing management" plugin add ad-hoc commands to changes permission of one or several shared files, delete one or more files, or regenerate thumbnails.
This is a temporary plugin to make file sharing through a component usable with other entities, but should be removed (at least permission management and file deletion) in the future if we move on a pubsub based solution.
2019-04-28 09:00:51 +02:00
Goffi
a3c67e1072 plugins (jingle) file transfer: use initial "from" attribute as local jid instead of client.jid:
while client.jid is fine in a client context, for components it's not the right jid to use: it is the jid of the component itself while the file transfer/jingle session entity may be established with this jid + a local part (e.g. if client is files.example.net, session may be established with louise@files.example.net, in which case "from" is louise@files.example.net, while client.jid will be files.example.net).

As a consequence, using client.jid was causing trouble with components.
This patch fixes it for jingle and plugins linked to file transfer by keeping a "local_jid" variable in the session, where the jid from the original "from" attribute is used.
2019-04-28 08:55:13 +02:00
Goffi
74bc166b88 plugin XEP-0384: wait for client to be ready if session is missing when onNewDevices is called 2019-04-28 08:55:07 +02:00
Goffi
bcba2ab9ae plugin XEP-0329: use local part of jid for components:
when used by a component, local part can now be used to specify owner of the file. Local part is escaped using XEP-0106, then:
- if the unescaped text contain a "@", it is used as a jid
- else, a jid is build by using this text and host of the component
2019-04-26 11:57:26 +02:00
Goffi
ae686b6368 plugin XEP-0106: jid escaping implementation 2019-04-26 11:57:26 +02:00
Goffi
007575d62b plugin XEP-0050: make plugin usable with components + new adHocError method to easily raise error when needed 2019-04-26 11:57:26 +02:00
Goffi
75fc5d3453 plugin XEP-0166: fixed missing key in warning log 2019-04-26 11:57:26 +02:00
Goffi
fae128d8fe plugin invitation file: wrong plugin had been uploaded:
this patch remove the test pluging erroneously uploaded, and add the right one instead
2019-04-26 11:57:26 +02:00
Goffi
ab861ef91c plugins sharing invitation, invitation, list of interest: handle invitation to a file sharing repository 2019-04-14 08:21:51 +02:00
Goffi
29b2a7cb11 plugin events: refactored invitation and personal lists logic:
- invitation logic has been moved to a new generic "plugin_exp_invitation" plugin
- plugin_misc_invitations has be rename "plugin_exp_email_invitation" to avoid confusion
- personal event list has be refactored to use a new experimental "list of interest", which regroup all interestings items, events or other ones
2019-04-14 08:21:51 +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
d85f1b364f jp, plugin merge-requests: used u'' as default for item id in pubsub arguments + fixed some required arguments:
u"" is now used as defaut item id instead of node, as it needs to be serialised anyway. This is temporary solution, as empty string can be used for item id (not forbidden by XEP-0060), but for now this is not handled correctly in jp/SàT (see https://bugs.goffi.org/bugs/view/289). Correct solution will probably need to use a special key in extra to mark empty string in id.
Added/removed some required values for node or item when it made sense.
2019-04-14 08:21:51 +02:00
Goffi
5e2426c065 core (memory), plugin XEP-0329, plugin invitation: minor style improvments 2019-04-14 08:21:51 +02:00
Goffi
6b83ef5c51 plugins: removed useless execute permission 2019-04-14 08:21:51 +02:00