Commit Graph

33 Commits

Author SHA1 Message Date
JC Brand 3530ccc35d Add initial TypeScript support and declaration files 2023-02-23 09:38:11 +01:00
JC Brand 15c10376b0 Rename all templates to camelCase
To conform with naming conventions regarding functions, which the
templates are.
2023-02-15 14:29:07 +01:00
JC Brand 40024f4599 Fixes #3028 Encrypted media not properly decrypting
Turns out that older versions Quicksy/Conversations use an IV of 16 bytes although the spec states 12
2022-10-26 09:10:45 +02:00
JC Brand 18d8b69f00 Bugfix. Use https for encrypted media unless hosted via localhost 2022-10-25 14:33:49 +02:00
JC Brand eb9fd74c77 Provide error message instead of aesm URL
when encrypted media cannot be decrypted because it can't be downloaded.
2022-10-23 11:56:59 +02:00
JC Brand b5bcc05947 Create `generatePreKeys` function 2022-05-08 23:37:47 +02:00
JC Brand d4382fda19 OMEMO bugfix. Don't auto-create device list without JID 2022-04-20 09:52:17 +02:00
JC Brand 32a443408a Bugfix. GIF unfurl images not loading...
and causing `TypeError: this.shouldRenderMedia is not a function`
2022-04-04 16:31:32 +02:00
JC Brand d2622f6fed Fixes #2557
Add the ability to send OMEMO corrections.

Refactor how OMEMO messages are sent to avoid having to override
`sendMessage` and thereby also allowing corrections of OMEMO messages to
be sent out.

Add two new hooks.
- getOutgoingMessageAttributes
- createMessageStanza
2022-03-13 10:02:34 +01:00
JC Brand 731e98b07c OMEMO fixes for completely new user
Fix bugs related to there not being a server-side device list (not even an empty one) for a new user.
2022-03-13 10:02:34 +01:00
JC Brand 89a3c81a19 OMEMO: don't wait for all device lists...
to be fetched from the server before triggering OMEMOInitialized.

For some contacts, the IQ to fetch the device list never receives a
response. IQ stanzas take 20 seconds to timeout, which means that all
OMEMO operations are blocked for 20 seconds (because everything waits
for `OMEMOInitialized`).

Create a new API method `api.omemo.devicelists.get` and use that to
fetch and `await` for any devicelist. That way we lazily wait for
devicelists to be fetched from the server and can continue with other
OMEMO operations unrelated to users who's clients don't respond to
devicelist queries.
2022-03-10 20:51:04 +01:00
afriedmanGlacier 3d8a583101
Wait for parseMessages before queuing to UI (#2803)
* parse messages before queuing

* update CHANGES

* remove unused variable

Co-authored-by: aFriedmanGlacier <afriedman@glaciersecurity.com>
2022-02-05 22:02:24 +01:00
JC Brand 0f648ed1eb Don't re-initialize OMEMO on reconnection
Promises only get recreated upon logout, not reconnection.

However OMEMO was getting re-initialized on reconnection and
`_converse.omemo_store` was also deleted.

This caused a race condition where an incoming MAM message would cause
`parseEncryptedMessage` that then throws an AttributeError because
`_converse.omemo_store` is undefined because OMEMO isn't yet
initialized.

Waiting for the `OMEMOInitialized` promise doesn't help because it's
still the old (already resolved) promise from before the reconnection.
2022-02-02 23:18:45 +01:00
JC Brand ac473fd297 Add dark theme Dracula
https://draculatheme.com
2022-01-28 20:28:48 +01:00
JC Brand bad2577e5e OMEMO Refactoring
When calling `getDeviceList`, wait for the devices to be fetched

Otherwise a race condition might occur, whereby a new device gets
created in the collection, and then removed again as the collection is
replaced with the values fetched from the browser-storage cache.

Also created `converse-omemo-fingerprints` component to asynchronously
render fingerprints in the user details modal. Was done as part of this
commit because due to `getDeviceList` being async, the relevant test for
the modal were also failing
2021-11-24 21:14:11 +01:00
JC Brand 9b1a7c70a3 Wait on `OMEMOInitialized` promise...
before parsing message stanza for encryption parameters.

Otherwise we might not know what our own device-id/sid is, and therefore
can't decrypt the incoming message.

Fixes #2733
2021-11-24 21:14:11 +01:00
JC Brand 07b2425ff9 Don't show unnecessary errors for undecryptable OMEMO messages
As mentioned in the XEP, don't show error messages for OMEMO messages
that can't be decrypted because they were already decrypted before or
because they weren't encrypted for this device.
2021-11-20 13:43:27 +01:00
JC Brand ecfc3e9fcf Implement support for XEP-0421 occupant ids
This let's us populate the `from_real_jid` attribute for messages in
cases where the user's nickname has changed.

Only save the occupant-id if the MUC supports it

Store all advertised features on the `chatbox.features` model.
This allows us to look up a feature without using the async
`disco.supports` API.

Updates #2241
2021-11-06 22:25:02 +01:00
JC Brand ca02bdcb61 Bugfix. Use real JID when setting up a device session in a MUC
Thanks to @orbitz, see: https://github.com/conversejs/converse.js/issues/1481#issuecomment-509183431

Updates #1481
2021-10-30 21:14:11 +02:00
JC Brand b75e67fafa Fixes #2629 OMEMO button tooltip is wrong in private chat 2021-09-06 20:59:26 +02:00
JC Brand 55146820e3 Use `converse-icon` in the `converse-dropdown` component
Instead of using webfonts
2021-07-26 19:27:59 +02:00
JC Brand 60826ac6c6 Move functions out of core.js 2021-07-19 16:40:40 +02:00
JC Brand b90a435833 Move url related utility methods to @converse/headless 2021-07-05 18:35:58 +02:00
JC Brand bff714f24c OMEMO: Include XEP-0380 EME tag in encrypted messages 2021-07-05 18:35:58 +02:00
JC Brand 01efb02f9e Make sure XEP-0363 urls are also OMEMO encrypted
by re-using `ChatBox.prototype.sendMessage`.

updates #1182
2021-07-03 00:22:03 +02:00
JC Brand e675c853f3 Add XEP-0454 support for encrypting files
Fixes #1182
2021-07-01 14:35:48 +02:00
JC Brand ba0ea6c2c4 Update translations based on suggestions from Zash on weblate 2021-06-25 10:38:38 +02:00
JC Brand 7848d8cb2f Add support for decrypting XEP-0454 OMEMO media 2021-06-25 09:24:18 +02:00
JC Brand 2c0fbec43c Move arraybuffer utility methods into their own file 2021-06-24 18:57:32 +02:00
Shaun Wu 9ea8653ef7 Upgrade to Webpack 3
Had to make various other changes due to incompatibilities.

- Use the new `lit` package instead of `lit-html` or `lit-element`
- Drop `haunted` since it breaks the rules by specifying `type: module`
  but then doesn't import with file extensions
- Use Sass Dart instead of node-sass (fixes #2445)
- Upgrade Karma
2021-04-30 13:50:50 +02:00
JC Brand 57ccf4c20e Batched writes to IndexedDB
- Update to the latest @converse/skeletor (which uses mergebounce to batch writes)
- Flush storage before logging out
- Flush when reloading the tab
- Create initStorage method
2021-04-28 16:53:50 +02:00
JC Brand 13e19eb7f8 Split omemo plugin into more files 2021-04-12 05:09:44 +02:00
JC Brand 573cc3e8d9 Split omemo plugin up into multiple files 2021-04-11 21:12:37 +02:00