Commit graph

3,192 commits

Author SHA1 Message Date
Goffi
5a9886d390 plugin attach: disable TLS check if "check_certificate" is disabled 2020-02-28 10:06:23 +01:00
Goffi
9de55ff588 memory (sqlite): don't store empty messages 2020-02-26 22:03:15 +01:00
Goffi
bd490c1d19 primitivus (chat) Q&D way to see attachments 2020-02-26 22:03:15 +01:00
Goffi
65dd411a2b quick frontend(contact list): new "isInRoster" method 2020-02-26 22:03:15 +01:00
Goffi
48c56ee57e memory(cache): extend EOL when a file metadata is retrieved 2020-02-26 22:03:15 +01:00
Goffi
f71b40f86f plugin download: use cache if dest_path is empty:
if dest_path is not set, the file will be downloaded in cache. A new name will be
generated using a hash of the uri. If the file is already downloded in cache, it won't be
downloaded again (in this case returned progress_id is an empty string).
2020-02-26 22:03:11 +01:00
Goffi
c16dd25fc9 plugin download, aesgcm: fixed handling of HTTP errors 2020-02-26 15:54:43 +01:00
Goffi
12fc57062d memory (cache): purge + pathlib:
- cache is now purged on backend startup (every file which has passed EOL will be deleted)
- use of pathlib, getPath now returns a Path
2020-02-26 15:54:43 +01:00
Goffi
b0c3d4d8ac core (xmpp): use pathlib.Path to complete attachments names, and use name to guess type 2020-02-26 15:54:34 +01:00
Goffi
1ba18cc1fa core (xmpp): complete attachments for sent attachments:
sent attachments are stored and sent back to frontends, so it is necessary to complete
them in the same way as incoming attachments.
2020-02-23 17:49:21 +01:00
Goffi
c5915d1dcb plugin attach, XEP-0363: progress id can now be specified:
progress id can be specified in options, using the "progress_id" option, this can be
more handy for frontends to keep track of attachments progresses.
2020-02-23 17:48:26 +01:00
Goffi
3b730721eb plugin attach: first draft:
this plugin handles the uploading of files attached in message data.
2020-02-23 17:48:26 +01:00
Goffi
619b6e9b4b core (memory/encryption): "isEncryptionRequested" helper method:
this method is similar to "isEncrypted" but for outgoing messages.
2020-02-23 17:48:26 +01:00
Goffi
a194874638 bridge: messageSend's extra is now serialised 2020-02-21 12:17:38 +01:00
Goffi
74a60a2e5b plugin aesgcm: use 12 bytes Initialisation Vector:
SàT was using 16 bytes IV when sending files withr AES-GCM, due to ChatSecure being only
compatible with that. Monal, an other iOS client is only compatible with 12 bytes IV, and
ChatSecure has fixed its code to also handle 12 bytes IV, so there is not reason anymore
to use 16 bytes, and SàT now uses 12 bytes.
2020-02-18 18:17:18 +01:00
Goffi
3d8ef1d625 jp (blog/edit): added --no-publish argument. 2020-02-18 18:17:18 +01:00
Goffi
8812915d4e quick frontends (chat): handle attachments in Message 2020-02-18 18:17:18 +01:00
Goffi
576c319d6e core (xmpp): add name and media_type in attachements if they are missing. 2020-02-18 18:17:18 +01:00
Goffi
5538b52f25 plugin aesgcm: look for "aesgcm" links in body to use them as attachments 2020-02-18 18:17:18 +01:00
Goffi
5b0e084a5d core (xmpp): new message key to handle attachments 2020-02-18 18:17:14 +01:00
Goffi
3b64263f3b core: renamed "MessageReceived" trigger to "messageReceived" for consistency. 2020-02-18 18:13:19 +01:00
Goffi
8fa4cd0f86 core (memory/encryption): new "isEncrypted" method to check if encrypted flag is set in message data 2020-02-18 18:13:18 +01:00
Goffi
6a7d247754 core: use serialised dict for extra in messageNew and historyGet 2020-02-18 18:13:17 +01:00
Goffi
13a4177c08 bridge constructor: replaced deprecated readfp 2020-02-14 15:18:52 +01:00
Goffi
aa203d4a49 quick frontends (widgets): added widgetNew and widgetDelete listeners:
- `widgetNew` is called when a brand new widget is created (not when a new instance is
  created if there is already an existing one)
- `widgetDelete` is called when all instances of a widget (with a given widget_hash) have
  been deleted.
2020-02-12 19:46:14 +01:00
Goffi
03204f56b9 quick frontends (app): added an "ignore_missing" argument to RemoveListener:
normally an error is logged when removeListener is call on a inexisting listener, but
sometimes listeners are added only in specific scenarios, and it may be handy to try to
delete them without having to explictly check that they have been used.
2020-02-12 19:44:05 +01:00
Goffi
0bbb13e6c4 quick frontend (app): replaced OrderedDict by regular dict:
since Python 3.7 dict are officially ordered, so there is no need to use a specific class
anymore.
2020-02-12 19:40:48 +01:00
Goffi
e8aaa9fd43 quick frontend(widget): added with_duplicates argument to getWidgets:
when this argument is False, widgets with the same widget_hash are filtered to only return
first one. It is True by default to keep former behaviour.
2020-02-12 19:38:32 +01:00
Goffi
697e91ff75 quick frontend(app): added listener for selected widget 2020-02-10 22:02:31 +01:00
Goffi
d684685e24 bridge: added methods to let frontends store/retrieve/delete private data 2020-02-10 22:01:53 +01:00
Goffi
104902f076 core (xmpp), plugin android: fixed DNS, SRV handling on Android:
Android doesn't have a "/etc/resolv.conf" that Twisted expect. As a result, SRV records
can't be checked correctly on connection.

To work around that, DNS servers used on Android are checked when necessary (on Android
plugin startup and on connectivity change), using some hacks, and Twisted is patched to
use them.
2020-02-09 23:56:42 +01:00
Goffi
bc3abd6920 tools (common/async_process): fixed stderr handling + added global "run" 2020-02-09 23:56:40 +01:00
Goffi
d0741de2ad core (memory/crypto): replaced PyCrypto by cryptography:
`PyCrypto` is unmaintained for years but was used in SàT for password hashing. This patch
fixes that by replacing `PyCrypto` by the reference `cryptography` module which is well
maintained.

The behaviour stays the same (except that previously async `hash`, `encrypt` and `decrypt`
methods are now synchronous, as they are quick and using a deferToThread may actually be
more resource intensive than using blocking methods).

It is planed to improve `memory.crypto` by using more up-to-date cryptography/hashing
algorithms in the future.

PyCrypto is no more a dependency of SàT
2020-02-09 23:50:26 +01:00
Goffi
5ef5f4aabf quick_frontend (app, widget): CagouWidget.onSelected is called when the widget is selected:
A property is now used to manage `selected_widget` in QuickApp, and widget's onSelected
method is called when suitable.
2020-02-09 23:50:21 +01:00
Goffi
9a9adb36cb quick frontend (app): added "explicit_close" to deleteWidget, and use it on mucRoomLeftHandler:
This flag can be used by frontends to decide if the widget must be really closed or not
(otherwise, it may be interesting to keep a widget in memory to avoir recreating a new one
each time that the chat must be displayed).
2020-02-06 00:01:36 +01:00
Goffi
5fae77187a tools (images): fixed type for recommended_size. 2020-02-05 23:59:19 +01:00
Goffi
d75bbaec4c core (memory/disco): fixed checkFeature return Failure:
it seems that instanciating a Failure with a class name is not working anymore, so the
exceptions.FeatureNotFound is instanciated now.
2020-02-04 19:59:42 +01:00
Goffi
ef1cd09c14 plugin XEP-0363: fixed errback args in fileHTTPUpload 2020-02-04 18:24:15 +01:00
Goffi
120289f08f plugin android: attach an action dict to notification:
instead of calling plyer's generic notify, AndroidNotification is now inherited to add a
SàT specific behaviour: a "sat_action" dictionary is now attached, to indicate to the
frontend what to do when the notification is opened.
2020-02-03 13:49:45 +01:00
Goffi
1a2078739e core (xmpp): avoid starting several clients at the same time:
a check is done to avoid running startConnection several times at once, which would lead
to the creation of several SatXMPPEntity instances at the same time, resulting in many
issues.

If startConnection is called while a previous one is not finished yet, a CancelError is
now raised.
2020-02-03 13:46:24 +01:00
Goffi
beb098b20a core (memory/disco): fixed failure creation in infosEb 2020-02-03 13:42:43 +01:00
Goffi
60522948f5 changelog: update 2020-01-29 20:52:23 +01:00
Goffi
45ebb5859d doc (profile): added --autoconnect info 2020-01-29 20:52:57 +01:00
Goffi
8d1305764a core (xmpp): use a stable resource (sat.[shortuuid]) instead of server one if nothing is specified 2020-01-29 20:21:21 +01:00
Goffi
ec5a51bebb core: log filenames of read config files 2020-01-29 19:42:02 +01:00
Goffi
3d86f0c983 core (constants): use parent of "sat" module dir as last config path 2020-01-29 19:28:08 +01:00
Goffi
6be3915b55 core (constants): missing trailing / 2020-01-29 19:21:16 +01:00
Goffi
21591bce92 core (constants): don't parse sat.conf from current dir anymore + parse root_dir last 2020-01-29 19:12:46 +01:00
Goffi
7f2c6cd8a6 core (constants): parse sat.conf from sat module dir 2020-01-29 19:05:41 +01:00
Goffi
4cb56362ec bridge (dbus): new bridge_dbus_int_prefix option (in [DEFAULT] settings) to change interface prefix 2020-01-29 18:54:40 +01:00