Commit graph libervia-backend/sat/plugins
Author SHA1 Message Date
Goffi
8895c9c898 plugin XEP-0277: fixed item2mbdata call 2020-08-15 20:29:07 +02:00
Goffi
937a1db89f component file sharing: added Access-Control-Expose-Headers CORS header:
without this header, the range header in response was not exposed to client. This could
cause trouble is a javascript application was needing to access it.
2020-08-15 20:28:07 +02:00
Goffi
53f475bf72 plugin identity: new methods identitiesGet and identitiesBaseGet
`identitiesGet` retrieve several identities at once, in parallel.
`identitiesBaseGet` retrieve essential identities (roster + own)
2020-08-13 23:46:18 +02:00
Goffi
4df2b3b1d6 plugin email invitation: new invitationDelete method 2020-08-13 23:46:18 +02:00
Goffi
f6a33c170b plugin email invitation: guests are now automatically added to host roster in guests group 2020-08-13 23:46:18 +02:00
Goffi
a8cb6e5a70 plugin email invitation: fixed create/simpleCreate + invitee_name:
- fixed invitationSimpleCreate signature
- fixed nicknames settings in create
- use async coroutines
- guest jid is now stored (as a string), avoiding the need to check profile to retrieve it
- invitee_name is now needed in invitationSimpleCreate
2020-08-13 23:46:18 +02:00
Goffi
e54d37fbc3 plugin XEP-0077: None can now be used in to_jid argument in unregister:
if None is used, the XMPP account of the profile will be deleted.
2020-08-13 23:46:18 +02:00
Goffi
88174c2100 plugin XEP-0329: download thumbnails:
- thumbnails are now downloaded directly when BoB is used, `filename` is then filled
- `utils.asDeferred` is now used for Jingle methods, so `async` coroutines can be used
- (XEP-0231): fixed `dumpData`
2020-08-13 23:46:18 +02:00
Goffi
bfa4bbae9e comp file sharing: minor core re-organisation 2020-08-13 23:46:18 +02:00
Goffi
5c46b74c69 plugin XEP-0264: fix orientation of thumbnails:
Rotation of thumbnailis is now modified according to EXIF orientation data. Original image
is not modified as user may want to keep it, and orientation transformation can modify
encoding parameters.

Update `pillow` minimum version to the first one with `exif_transpose` implementation.
2020-08-13 23:46:18 +02:00
Goffi
7e404b9f98 plugin XEP-0264: updated size to get values closest to standard one:
- sizes used for thumbnails are now matching common resolutions.
- added BIG and FULL_SCREEN sizes
- sort thumbnails by sizes when parsing them.
2020-08-13 23:45:59 +02:00
Goffi
f2085455f7 plugin XEP-0277: set "uri" in item2mbdata 2020-08-03 08:45:49 +02:00
Goffi
92aa584e4c plugin identity: added "filename" metadata for avatar 2020-08-02 17:40:07 +02:00
Goffi
9ee767d0cb plugins invitation, invitation-file: adapt service JID and affiliation:
if the user part of the service is missing while creating and invitation, it's added
because using only the domain will lead to a different repository depending on the
requester. In addition, the invitee is added to the repostiroy path as a member, to be
sure he/she can access it.
2020-08-01 16:24:03 +02:00
Goffi
3f739a8ac8 plugin email invitation: simple invitation creation
The new `invitationSimpleCreate` is a simplified way to create an email invitation.
2020-08-01 16:19:50 +02:00
Goffi
25a429fa1b plugin list for interest: build ID using URI or file path metadata:
by using those metadata, we get the same ID for 2 interests linking to the same location.
This has been done to avoid duplicated interests.
2020-08-01 16:17:19 +02:00
Goffi
7dd1873adf plugin XEP-0329: added way to change access_model using PubSub-like configuration:
Those methods are not standard, but have been done in a PubSub-like way to prepare the
move to a PubSub based file sharing system.
2020-08-01 16:14:37 +02:00
Goffi
3b5d2313a2 plugin XEP-0329: implemented ways to get/set affiliations:
PubSub-like affiliations can now be get/set using non standard methods. This has been done
to prepare the move to a pubsub based file sharing system.
2020-08-01 16:12:44 +02:00
Goffi
ef23eca7cd plugin XEP-0050: typo 2020-08-01 15:58:20 +02:00
Goffi
d7844a98b4 component file sharing: add/parse affiliation when possible 2020-07-17 13:00:10 +02:00
Goffi
f8b346e115 plugin XEP-0060: serialise psItemsGet result with data_format 2020-07-17 12:57:23 +02:00
Goffi
95096df52f plugins tickets, merge-requests: ticketsGet and mergeRequestsGet serialisation:
those methods now return data serialised with `data_format.serialise`
2020-07-16 09:07:26 +02:00
Goffi
e03eb5bfcc plugins XEP-0059, XEP-0060, XEP-0277, XEP-0313: better serialisation:
`data_format.serialise` is now used for `mbGet`, and RSM/MAM values are not transtyped to
strings anymore. A serialised dict is now used, items are put in the `items` key.

Comments handling has been refactored to use a list for the potentially multiple comments
nodes.

`rsm` data are now in a `rsm` key of the dict, and `mam` data are merged with other
metadata.
2020-07-16 09:07:20 +02:00
Goffi
c68eb151ec plugin file sharing management: added a fileSharingDelete method 2020-06-19 15:39:32 +02:00
Goffi
348ca4d2cb plugin list of interests: added id to data + fixed key conflict:
fixed conflict between interest namespace and files namespace.
2020-06-19 15:38:17 +02:00
Goffi
c2788fea50 plugin list of interest: new "interestRetract" method 2020-06-19 15:37:02 +02:00
Goffi
762f96acb2 plugin XEP-0050: some modernisation + adHocSequence:
improved code by reordering imports, adding some type hints, using standard dict instead
of OrderedDict, etc.

New sequence method/adHocSequence bridge method allow to easily send a sequence of data to
a well known ad-hoc node.
2020-06-19 15:35:45 +02:00
Goffi
86aaf35b60 comp file sharing: file paths are now quoted on upload to allow unicode 2020-06-19 14:56:45 +02:00
Goffi
9f9a6a5a2b plugin list of interest: expose interestsRegisterFileSharing to bridge + use coroutines 2020-06-09 06:25:20 +02:00
Goffi
47edb01bd3 comp file sharing management: fixed confirmation check 2020-06-09 06:23:37 +02:00
Goffi
87298f8a19 comp file sharing: handle upload with headers:
`Xmpp-File-Path` can now be used to specify file path, and `Xmpp-File-No-Http` when file
must not be served publicly by HTTP.
2020-06-09 06:23:01 +02:00
Goffi
4ecdb41695 comp file sharing: CORS:
- added CORS headers to allow using the HTTP server from an other domain
- added `Content-Security-Policy`
2020-06-09 06:21:23 +02:00
Goffi
43466029ab plugin XEP-0363: register namespace 2020-06-09 05:59:14 +02:00
Goffi
e712981938 plugin XEP-0363: fixed fileHTTPUploadGetSlot 2020-06-09 05:58:57 +02:00
Goffi
ca655f01a8 component file sharing: don't initialise the plugin if not component use it 2020-06-01 11:15:16 +02:00
Goffi
5a14c5aebd plugin comp file sharing: files can now be uploaded/downloaded via HTTP:
plugin XEP-0363 can now be used by components, and file sharing uses it.
The new `public_id` file metadata is used to serve files.
Files uploaded are put in the `/uploads` path.
2020-05-29 21:55:45 +02:00
Goffi
d1521dde4b core (memory/sqlite): new database schema (v9):
this new schema brings the new `public_id` column, which will be used to serve files via
HTTP, splits `mime_type` in 2 (`media_type` and `media_subtype`) to make indexing/media
filtering easier, and fixes indexes for `files` table.
2020-05-29 21:50:49 +02:00
Goffi
8da309e51e plugin XEP-0300; fixed use of calculateHash with getHasher 2020-05-29 21:06:10 +02:00
Goffi
4fdf49f4cb plugin XEP-0054: don't use cache anymore in getAvatar:
caching is now handled by plugin identity.
2020-05-19 18:34:06 +02:00
Goffi
771e40dad5 plugin identity: fixed update in avatarSetPostTreatment 2020-05-19 18:34:05 +02:00
Goffi
7438f4218e plugin identity: fixed infinite loop on nicknames update 2020-05-18 23:52:34 +02:00
Goffi
234bbcbdd5 plugin XEP-0231, XEP-0264: fixed some remaining encoding issue following Python 3 port 2020-05-18 23:39:41 +02:00
Goffi
abbd14484b plugin XEP-0060: fixed payload parsing in sendItem 2020-05-18 23:38:21 +02:00
Goffi
9780bd3480 plugin pubsub schema, tools (common/template xmlui): use a JID for publisher:
- a JidWidget is used instead of text for publisher, nothing is set if publisher attribute
  doesn't exist
- added missing JidWidget implementation in tools.common.template_xmlui
2020-05-18 23:37:04 +02:00
Goffi
a693f9f53e plugin list of interest: fixed wrong variable used in a log 2020-05-18 23:31:55 +02:00
Goffi
81650a8ed4 plugin identity: fixed update when cached data is None 2020-04-20 14:51:58 +02:00
Goffi
2591e8e444 plugin XEP-0054: SVG images can now be uploaded for avatars. 2020-04-19 16:40:34 +02:00
Goffi
678adcb697 plugin identity: fixed update with get_all + better new data detection for avatar:
- when metadata doesn't exist, update with `get_all` set doesn't crash anymore.
- fixed avatarUpdateIsNewData
2020-04-19 16:38:46 +02:00
Goffi
88072e0453 core, frontends: avatar refactoring:
/!\ huge commit

Avatar logic has been reworked around the IDENTITY plugin: plugins able to handle avatar
or other identity related metadata (like nicknames) register to IDENTITY plugin in the
same way as for other features like download/upload. Once registered, IDENTITY plugin will
call them when suitable in order of priority, and handle caching.

Methods to manage those metadata from frontend now use serialised data.

For now `avatar` and `nicknames` are handled:

- `avatar` is now a dict with `path` + metadata like `media_type`, instead of just a string
  path
- `nicknames` is now a list of nicknames in order of priority. This list is never empty,
  and `nicknames[0]` should be the preferred nickname to use by frontends in most cases.
  In addition to contact specified nicknames, user set nickname (the one set in roster) is
  used in priority when available.

Among the side changes done with this commit, there are:

- a new `contactGet` bridge method to get roster metadata for a single contact
- SatPresenceProtocol.send returns a Deferred to check when it has actually been sent
- memory's methods to handle entities data now use `client` as first argument
- metadata filter can be specified with `getIdentity`
- `getAvatar` and `setAvatar` are now part of the IDENTITY plugin instead of XEP-0054 (and
  there signature has changed)
- `isRoom` and `getBareOrFull` are now part of XEP-0045 plugin
- jp avatar/get command uses `xdg-open` first when available for `--show` flag
- `--no-cache` has been added to jp avatar/get and identity/get
- jp identity/set has been simplified, explicit options (`--nickname` only for now) are
  used instead of `--field`. `--field` may come back in the future if necessary for extra
  data.
- QuickContactList `SetContact` now handle None as a value, and doesn't use it to delete the
  metadata anymore
- improved cache handling for `metadata` and `nicknames` in quick frontend
- new `default` argument in QuickContactList `getCache`
2020-04-14 21:00:33 +02:00
Goffi
68a4d8ea98 core (memory/persistent): fixed "items", added "all" + "adel" to LazyPersistentBinaryDict:
- `items` was returning the dict with all values, it now returns a Deferred with actual dict items()
- `all` new method does return the dict with all values (in a Deferred)
- `adel` has been added to LazyPersistentBinaryDict
2020-04-14 20:36:24 +02:00