Commit graph

3,215 commits

Author SHA1 Message Date
Goffi
31e9cc7cbf core (tools/utils): new asDeferred function:
asDeferred is similar to defer.maybeCoroutine, and also handles coroutine.
2020-03-13 17:46:27 +01:00
Goffi
1faa5e82da plugin XEP-0384: use "max_items=1" for devices and bundles nodes:
- max_items = 1 is requested with publish-options when publishing the bundle or the
  devices list. If the constraint is failed, a warning will be shown, and the publication
  will be done without this option
- fixed return values when devices list is badly formed
2020-03-11 20:44:49 +01: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
e0a5e96b16 jp (xmlui): added missing disp method in XMLUIPanel 2020-03-06 18:51:04 +01:00
Goffi
0ce6d6d841 plugin download: clean unfinished files and re-raise exception in case of download error 2020-03-06 18:19:03 +01:00
Goffi
46a8728d7c core (memory/cache): new removeFromCache method 2020-03-06 18:19:03 +01:00
Goffi
4b69d89138 core (memory/cache): purge cache metadata when the referenced file doesn't exist 2020-03-06 18:19:03 +01:00
Goffi
5e4e10e690 bridge (constructor/dbus): typo 2020-03-06 18:19:03 +01:00
Goffi
dced27f328 jp(info): devices command first draft:
this command gather data on known devices of an entity.
2020-03-06 18:19:03 +01:00
Goffi
5a467b15d5 core, bridge: new devicesInfosGet method to get infos on known devices of an entity 2020-03-06 18:19:03 +01:00
Goffi
1883dbd3ab plugin download, aesgcm: disable TLS check if check_certificate setting is disabled 2020-03-06 18:19:03 +01:00
Goffi
d0df1d8aeb quick frontend(app): new QuickApp.profileConnected method 2020-03-06 18:19:03 +01:00
Goffi
f7360d31e2 core (xmpp): isConnected now returns True when full connection is done:
isConnected was returning True as soon as transport was connected. It is now returning
True only if full connection is done (i.e. transport is connected + all plugins have been
initialised).
2020-03-06 18:19:03 +01:00
Goffi
4c474efb3d plugin attachment: remove "path" from attachment once used:
"path" refers to a local path of a file, we don't want to store it in database as the file
may be in a temporary location, or even be a temporary file. So once the file has been
uploaded, we remove it.
2020-03-06 18:19:03 +01:00
Goffi
3686d7e036 core, bridge: new imageGeneratePreview helped method to generate a thumbnail 2020-03-01 18:48:06 +01:00
Goffi
8777bd07cb tools (images): max_size can now be manually specified in checkImage and dest in resizeImage:
`context` has been removed as it is not used and doesn't seem that useful.
2020-03-01 18:47:05 +01:00
Goffi
143dd9bc0a plugin XEP-0054: fixed use of current dir instead of empty string 2020-03-01 18:33:16 +01:00
Goffi
dfbdf8e455 core (memory/cache): added some metadata:
- creation/last_access are now set
- use filename to guess MIME type when suitable
2020-03-01 18:31:45 +01:00
Goffi
e2a5f7394e core (xmpp): check that entity_jid is actually a jid in SatRosterProtocol.isJidInRoster 2020-03-01 18:29:46 +01:00
Goffi
7924b601ab core (constants): renamed MESS_KEY_MEDIA_TYPE to MESS_KEY_ATTACHMENTS_MEDIA_TYPE 2020-02-29 16:55:22 +01:00
Goffi
fd1cc3dd40 changelog: update 2020-02-28 18:10:58 +01:00
Goffi
a1dc5a5c06 core (memory/disco): minor log message change 2020-02-28 10:06:38 +01:00
Goffi
94fccd1176 quick frontend (app): avoid crash when a listener is removed while being called 2020-02-28 10:06:38 +01:00
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