Commit graph

3,270 commits

Author SHA1 Message Date
Goffi
a693f9f53e plugin list of interest: fixed wrong variable used in a log 2020-05-18 23:31:55 +02:00
Goffi
b5a872aed3 core (constants): added theme key 2020-05-18 23:30:55 +02:00
Goffi
19a9e38983 tools (common/template): theme settings with possibility to disable default fallback for CSS:
- themes can now have a `settings.json` file at their root to modify the renderer
  behaviour
- the `css_default_fallback` boolean (true by default) can be used to disable the fallback
  mechanism when CSS files are checked. Useful when a theme doesn't follow the CSS naming of
  default theme.
- introduced some type hints
2020-05-03 17:01:39 +02:00
Goffi
2908be8898 tools (common/template): typos 2020-05-03 13:40:04 +02:00
Goffi
3f735d406e tools (common/template): list themes and parse their browser data, available through new getThemesData method 2020-05-01 16:26:39 +02:00
Goffi
794b5be810 tools (common/utils): new recursive_update method for dicts 2020-04-29 13:53:00 +02:00
Goffi
a5aac84c6a tools (common/data_objects): added __iter__ to Identities 2020-04-25 15:54:26 +02:00
Goffi
ee53fae57b bin (sat): check twistd before twistd3 to use venv version first 2020-04-20 14:52:57 +02:00
Goffi
81650a8ed4 plugin identity: fixed update when cached data is None 2020-04-20 14:51:58 +02:00
Goffi
5b217e1b40 tools (common/data_objects): new avatar_basename property 2020-04-19 22:52:15 +02:00
Goffi
f85cdc7f37 doc (installation): updated instructions for backend 2020-04-19 16:54:13 +02:00
Goffi
47ec15cc46 core: image convertion + SVG support:
/!\ new optional dependency: CairoSVG (with installed `[SVG]` extra)

- new `convert` method in `tools.image` to save an image in an other format, with support
  for SVG (when CairoSVG is available)
- new `imageConvert` method is available for frontends
2020-04-19 16:53:44 +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
95ae0f7257 changelog: update 2020-04-14 21:01:13 +02:00
Goffi
7a2ab7c468 jp (roster): new roster/set command 2020-04-14 21:01:04 +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
Goffi
7fb86a0af4 tools (image): added a guess_type method to guess media type:
media type is guessed first from filename, then if it's not enough, the file is opened to
try to guess type. If it still can be determined, None is returned.
2020-04-14 20:29:37 +02:00
Goffi
4bb69e971d doc (config): fixed documentation about configuration file possible paths + minor corrections. 2020-04-14 20:26:47 +02:00
Goffi
83260b827a core (memory/disco): fixed types of disco extensions:
typeCheck() is not automatically called on reception by Wokkel, as a result extensions
fields values may be strings instead of the field type. TypeCheck is now explicitly
called in memory.disco to avoid that. It is not called immediately on reception as the
string value is needed to calculate the capability hash
2020-04-14 20:25:05 +02:00
Goffi
7201730938 core (xmpp): helper method to launch a plugin method:
the `p` client method can be used to launch a method for a plugin, with a default value if
the plugin is not available (or an Exception to raise).
2020-04-03 18:02:31 +02:00
Goffi
1a5996ac4b core (exceptions): new MissingPlugin exception:
it is used when a feature needs an inactive or unavailable plugin.
2020-04-03 18:02:27 +02:00
Goffi
346281f484 changelog: replaced "geo:" by URIs:
Changed wording because Cagou now tries to open any kind of URI with the right
application, not only "geo:" ones.
2020-04-01 23:46:46 +02:00
Goffi
ef90f2d3f7 tools (common/files_utils): put extra suffix before file extension 2020-04-01 22:29:43 +02:00
Goffi
e573f7f627 plugin android: use certifi SSL root certicates 2020-04-01 22:28:50 +02:00
Goffi
cf82140690 core (xmpp): properly clean profile data in case of startConnection failure:
- profile is now always removed from profiles_connecting
- an exception is raised if client already exists only if client is connected. Otherwise,
  it's deleted (this allow to keep session open to e.g. modify settings in case of failure
  during connection)
2020-04-01 16:17:09 +02:00
Goffi
81de80348b bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge 2020-04-01 15:40:29 +02:00
Goffi
e2d9c7db4a bridge (dbus): fixed typo in log.warning 2020-04-01 15:32:18 +02:00
Goffi
09cb00b5b1 jp (blog/edit): --no-publish is a boolean option 2020-03-31 08:45:49 +02:00
Goffi
bd94d2620d plugin XEP-0384: fixed /omemo_reset + device ID type:
- the workflow done with /omemo_reset is now using the right methods
  (encryptRatchetForwardingMessage and decryptRatchetForwardingMessage)
- fixed type error with device when calling python-omemo methods: a mix of str and int
  was leading to two caches being created, and random bugs
2020-03-30 19:59:17 +02:00
Goffi
067fcbe235 core (tools/utils): fixed return value for non async callbacks 2020-03-30 19:59:14 +02:00
Goffi
e8269d8f6a core (xmpp): use asDeferred for profileConnecting and profileConnected 2020-03-30 19:59:12 +02:00
Goffi
cabaa16279 plugin XEP-0384: OMEMO trust policy:
OMEMO trust policy can now be specified. For now there are 2 policies:

- `manual`: each new device fingerprint must be explicitly trusted or not before the
  device can be used, and the message sent
- `BTBV` (Blind Trust Before Verification): each new device fingerprint is automically
  trusted, until user manually trust or not a device, in which case the behaviour becomes
  the same as for `manual` for the entity. When using the Trust UI, user can put the
  entity back to blind trust if they wish.

A message is send as feedback to user when a new device is/must be trusted, trying to
explain clearly what's happening to the user.

Devices which have been automically trusted are marked, so user can know which ones may
cause security issue.
2020-03-27 10:02:14 +01:00
Goffi
240c62903d plugin XEP-0384: added resetTrust in OmemoSession 2020-03-27 09:55:16 +01:00
Goffi
b878c3327f core (memory/encryption): use utils.asDeferred for trust UI, so async coroutines can be used 2020-03-27 09:53:59 +01:00
Goffi
973beb4220 core (memory/persistent): added aset method in LazyPersistentBinaryDict:
this method does the same as `force` but is there to be consistent with PersistentDict.
`force` should be removed in the future.
2020-03-27 09:53:00 +01:00
Goffi
56d6613c4d tools (xl_tools): fixed handling of list options labels 2020-03-27 09:50:42 +01:00
Goffi
658da6abe4 quick frontend (app): fixed argument order in messageSend default errback 2020-03-23 17:53:29 +01:00
Goffi
2f8902e0d6 core (memory/encryption): automatic start encryption if peer send encrypted message:
If peer sends encrypted message and we have no encryption activated, we automatically
start encryption to avoid sending plain text message when answering.

markAsEncrypted now needs the encryption algorithm namespace as mandatory argument.
2020-03-23 17:52:18 +01:00
Goffi
a6e4d1d33f changelog: update 2020-03-23 16:55:15 +01:00
Goffi
741bd88a19 quick frontend (chat): added encrypted property 2020-03-23 16:53:29 +01:00
Goffi
8e9905363e core (memory/encryption): set encrypted flag also for outgoing messages and put it in extra:
- `encrypted` flag is now put directly in extra, so that there is nothing to change when
  sending the message to bridge for frontends to be aware of it.
- this flag is now also set when markAsEncrypted is used, so frontend can display
  appropriate indicator to show that outgoing message is encrypted or not.
2020-03-23 16:53:03 +01:00
Goffi
70600d62f3 changelog: update 2020-03-22 18:47:59 +01:00
Goffi
900daa7ad9 core (memory/encryption): encryption session are now restored on client connection 2020-03-22 18:39:12 +01:00
Goffi
e754d16000 core (memory/persistent): implemented aset and adel:
those methods are async variants of __setitem__ and __delitem__, they return a Deferred
fired when the value is actually set/removed from storage.
2020-03-22 18:35:22 +01:00
Goffi
f7b91d3d91 core (xmpp): use async corouting for startConnection 2020-03-22 14:31:48 +01:00
Goffi
ddf8cf6ea7 plugin attach: handle large images resizing:
if `C.MESS_KEY_ATTACHMENTS_RESIZE` flag is set for an attachment, it will be checked, and
if it is a large image, a resized copy will be uploaded.
2020-03-22 14:04:16 +01:00
Goffi
cdf468a7c1 plugin aesgcm: wait for each splitted message to be sent before sending next one 2020-03-22 14:01:47 +01:00
Goffi
be95a78a7c core (xmpp): fixed workflow with post_xml_treatments in sendMessage:
post_xml_treatments was incorrectly added to workflow using chainDeferred (which only
add the callback, so post_xml_treatments own callbacks were not waited). As a result,
plugins callback could not be waited as expected before a message was sent.

This patch fixes it by not using chainDeferred anymore.
2020-03-22 13:59:19 +01:00