Commit graph libervia-backend/sat/plugins
Author SHA1 Message Date
Goffi
2555649dfb plugin android: sound notification + change settings:
- new notification sound
- vibration and notification sound are now activated depending on ringer mode (normal,
  vibrate or silent)
- notification sound/vibration can be configured in settings.
2020-01-03 13:21:27 +01:00
Goffi
b5af781b82 plugin XEP-0384: OMEMO for MUC implementation:
- encryption is now allowed for group chats
- when an encryption is requested for a MUC, real jids or all occupants are used to
  encrypt the message
- a cache for plain text message sent to MUC is used, because for security reason we can't
  encrypt message for our own device with OMEMO (that would prevent ratchet and break the
  prefect forward secrecy). Thus, message sent in MUC are cached for 5 min, and the
  decrypted version is used when found. We don't send immediately the plain text message
  to frontends and history because we want to keep the same MUC behaviour as for plain
  text, and receiving a message means that it was received and sent back by MUC service
- <origin-id> is used to identify messages sent by our device
- a feedback_jid is now use to use correct entity for feedback message in case of problem:
  with a room we have to send feedback message to the room and not the the emitter
- encryptMessage now only accepts list in the renamed "entity_bare_jids" argument
2019-12-30 20:59:46 +01:00
Goffi
a1ee6fedc1 plugin XEP-0359: handle origin-id 2019-12-30 20:44:05 +01:00
Goffi
efe52d755d plugin XEP-0045: added room statuses to metadata:
room statuses are now sent with other metadata on bridge signals, and saved in Room
instance. They give useful data on the room, for instance they can be used to know if a
full jid is used in this room.
2019-12-30 20:44:02 +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
bca7453ee1 plugin XEP-0384: typo 2019-12-20 14:26:05 +01:00
Goffi
3e07cd6c01 plugin android: removed comment on vibrator bug as it is fixed in dev version of plyer 2019-12-20 12:28:04 +01:00
Goffi
f9a034509c plugin sec aesgcm: new plugin handling aesgcm: scheme for e2e encrypted media sharing:
The scheme is register with download meta plugin, and it is activated with HTTP Upload
(XEP-0363) when `encryption` is used in `options` with the value of C.ENC_AES_GCM.
This is also known as `OMEMO Media Sharing` even if this method is not directly linked to
OMEMO and can be used independently.
2019-12-20 12:28:04 +01:00
Goffi
edbee4d719 plugin upload, XEP-0363: code modernisation + preparation for extension:
- use of async/await syntax
- fileUpload's options are now serialised, allowing non string values
- (XEP-0363) Slot is now a dataclass, so it can be modified by other plugins
- (XEP-0363) Moved SSL related code to the new tools.web module
- (XEP-0363) added `XEP-0363_upload_size` and `XEP-0363_upload` trigger points
- a Deferred is not used anymore for `progress_id`, the value is directly returned
2019-12-20 12:28:04 +01:00
Goffi
dfed376f62 plugin file download: meta plugin to handle file download:
- first code in backend to use async/await Python syntax \o/
- plugin with file upload
- URL schemes can be registered
- `http` and `https` schemes are handled by default
2019-12-20 12:28:04 +01:00
Goffi
26c01ca4dc plugin XEP-0045: show join error even if it's not a StanzaError, log it with warning instead of error 2019-12-20 12:28:04 +01:00
Goffi
a300181a01 plugin XEP-0384: update to latest python-omemo + better trust management:
- python-omemo minimal version is now 0.11.0
- `undecided` devices are now handled, fixing the "accept all or none" issue: if a device
  is `undecided`, the trust manager will be shown with the missing devices before sending
  the message.
- `untrusted` devices are discarded
2019-12-20 12:28:01 +01:00
Goffi
ad1ec9698c plugin XEP-0384: specific warning on missing omemo-backend-signal + fixed encoding following Python 3 port 2019-12-07 11:30:56 +01:00
Goffi
3d7cda8eb5 plugin events: fixed eventInviteeGet signature 2019-12-06 15:20:00 +01:00
Goffi
c01889f16c plugin manhole: fixed default value 2019-12-06 15:19:31 +01:00
Goffi
808790933a plugins (imap, maildir, smtp): removed plugins IMAP, Maildir and SMTP:
they were experimental plugins, are not used and Maildir has not been ported to Python 3
2019-12-06 15:02:02 +01:00
Goffi
dc930b1890 plugin XEP-0045: don't fail on item-not-found with MAM:
Some servers don't store permanently the whole history of MUC with MAM. As a result, an
"item-not-found" stanza error can be received when message id used as reference doesn't exist
anymore on the server.
When this case happens, the history is retrieved in the same way as for a newly joined room
(i.e. last 50 messages are requested).
2019-12-05 23:05:16 +01:00
Goffi
c1fa2cf13b plugin text syntaxes: don't use anymore deprecated cgi.escape 2019-11-18 20:50:34 +01:00
Goffi
d2a51169b2 plugin pubsub schema: fixed XML field handling in sendDataFormItem 2019-11-08 12:51:03 +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
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