Commit Graph

61 Commits

Author SHA1 Message Date
JC Brand
1a3526f537 Update openAndEnterChatRoom to take JID 2019-07-04 08:28:12 +02:00
JC Brand
36549bf61d Revert flexbox, column-reverse changes
Unfortunately this doesn't work on Firefox and there's no proper
workaround. https://github.com/philipwalton/flexbugs/issues/108

Reverts:

Revert "Bugfix. Properly insert error messages and spinner"
This reverts commit 6a419cc145.

Revert "Use flexbox to keep the chat scrolled down"
This reverts commit dd91d3cc55.
2019-06-19 11:45:54 +02:00
JC Brand
dd91d3cc55 Use flexbox to keep the chat scrolled down
By using `display: flex` and `flex-direction: column-reverse`, the chat
now automatically scrolls down when loaded, without requiring any
extra JavaScript.

We still need to scroll down with JavaScript when sending a message.

By using `column-reverse`, the messages container now works in reverse.
So the newest message is the first element in the container and the
oldest message is the last. This is the reverse of before.

Due to this, this change will likely break some plugins.
2019-06-18 11:37:07 +02:00
JC Brand
737e27c726 Use shakespearean character names in tests 2019-06-03 09:43:24 +02:00
JC Brand
e1762a1bb5 Rename key event handler methods to avoid confusion 2019-05-26 11:09:43 +02:00
JC Brand
a95bb5b26a Refactor tests so that IQ_ids always contains only XML stanzas 2019-05-20 14:37:29 +02:00
JC Brand
21ca33ec29 Bugfix. Create device based on prekey message for from JID
Otherwise for sent carbons we created it for the wrong user.
2019-03-31 19:36:04 +02:00
JC Brand
dd0c0b6c56 Add a new active flag for OMEMO devices.
Instead of deleting devices that are not returned in the device list,
set an `active` flag, so that we don't remove the trust setting.

Set deactivated devices to `active` when a receive an OMEMO message from
it.

Also, set omemo_supported to true when we've succesfully decrypted a
message.
2019-03-31 11:33:31 +02:00
JC Brand
1dfdb36d20 Don't filter out own device when sending OMEMO message 2019-03-30 13:55:25 +01:00
JC Brand
f897703565 Rename emit to trigger for consistency with Backbone.Events 2019-03-29 21:56:56 +01:00
JC Brand
9f5031c278 Make converse.initialize an async function
- Combine all test init functions into `initConverse`
- Use `async` functions in more tests
- Replace `var` with `let` and `const` in more tests
- New utils method `toStanza` which converts a string to a Node
2019-02-12 15:34:50 +01:00
JC Brand
c023bd1d47 Fix test failures on Chrome 72 2019-02-01 21:37:29 +01:00
JC Brand
a4d608dcdf Save room features in separate model
As a namespacing mechanism to avoid clashes.
Fixes bug where two chats are shown as currently being active in the rooms list.
2019-01-10 12:15:59 +01:00
JC Brand
7750194522 Bump timeout to try and appease travis 2019-01-04 08:19:58 +01:00
JC Brand
cdd0382241 Increase wait timeouts 2019-01-03 13:19:54 +01:00
JC Brand
aa3cbaa3c3 Add logging to debug issue on travis 2019-01-03 10:57:14 +01:00
JC Brand
be1be3534c Don't render the lock icon when the MUC doesn't qualify
Updates #1180
2018-12-21 06:29:21 +01:00
JC Brand
9aca32ad97 Handle errors when sending encrypted groupchat messages
updates #1180
2018-12-21 06:29:21 +01:00
JC Brand
85dab7367b Use pubsub#access_model to publish keys and devices publically 2018-12-21 04:35:28 +01:00
JC Brand
9c05ca9a09 Add test for sending/receiving MUC OMEMO messages
While adding support for MUCs, I refactored converse-omemo somewhat to move functions
out of `overrides` and to use async/await

Updates #1180
2018-12-20 21:51:16 +01:00
JC Brand
f64fdb8088 Render the OMEMO lock icon in MUC toolbars as well
updates #1180
2018-12-20 21:51:16 +01:00
JC Brand
d5485d09ae Always render the OMEMO lock icon
When OMEMO isn't possible, render it as grey.

This change makes OMEMO for MUCs easier, since there I anticipate that
OMEMO support might change dynamically based on who enters/exits the
room.

updates #1180
2018-12-14 11:25:57 +01:00
Christoph Scholz
da5ca0b585 implement XEP-0184: Message Delivery Receipts 2018-11-13 17:13:35 +01:00
JC Brand
a5a600bade Fixes #1193 Properly handle OMEMO messages without body tag 2018-10-15 23:47:22 +02:00
JC Brand
439d13d311 Use async/await instead of promise callbacks 2018-10-15 23:18:06 +02:00
JC Brand
7cc59b9ef3 Check in test that headliness box is not created.
Updates #1221
2018-10-10 20:17:56 +02:00
JC Brand
9bc8bdf34c Test updates after updating to use latest strophe.js
`toLocaleString` now returns element attributes in alphabetical order
(for better cross-browser consistency).

Also, `toLocaleString` is now used in favor of `outerHTML` because
browsers aren't consistent with one another in their output.
2018-10-03 21:11:20 +02:00
JC Brand
defe32d172 Make sure omemo tests pass on Firefox 2018-09-25 14:05:56 +02:00
JC Brand
6a061b4525 Use raw key format and not jwk. Set correct key size. 2018-08-31 17:15:03 +02:00
JC Brand
ed9afe9afb Only include key and not whole payload from libsignal 2018-08-31 13:57:49 +02:00
JC Brand
1dc1c1f98a Properly generate and render fingerprints 2018-08-27 21:02:31 +02:00
JC Brand
3e7c8655ad Add a <store> hint to OMEMO messages.
updates #497
2018-08-27 16:44:19 +02:00
JC Brand
15a4bcd11e Add method to generate missing prekeys
When receiving a PreKeySignalMessage, then a prekey has been chosen and
should now be removed from the list of available prekeys in the bundle,
so that a different device doesn't choose it as well.

AFAICT, libsignal removes the prekey, so it's then up to us to
regenerate it and republish our bundle.

updates #497
2018-08-27 16:43:58 +02:00
JC Brand
3d015c787f Extract common code into helper functions 2018-08-27 10:41:54 +02:00
JC Brand
ea5144c7e5 Refactor the OMEMOStore to not duplicate prekeys
Before these changes, prekeys were stored in two places, one place that
converse-omemo accessed and one that libsignal accessed and when
libsignal deleted a prekey the other store wasn't updated.

Now we let the methods called by libsignal store/remove prekeys (and the
signed_prekey) in the same place as used by the code in converse-omemo.
2018-08-25 23:22:18 +02:00
JC Brand
fd639e2da6 Remove the active flag for devices.
Instead of setting `active` to `false`, we remove the device entirely
(unless its the current device).

Doing it this way means more fetching of bundles for devices that
disappear and then reappear from a user's devicelist.

However, there might be caching invalidation concerns with just reusing
a cached bundle for a device id that disappeared and then reappears.

Additionally this change simplifies the showing of a contact's device
fingerprints in the modal, since we don't have to take active/inactive
into consideration.

updates #497
2018-08-23 14:02:43 +02:00
JC Brand
fa0e7aeff5 Updated so that own device is properly created and published
Based on live testing. Updated tests accordingly.
2018-08-22 18:16:36 +02:00
JC Brand
3ec426e11d Don't render OMEMO stuff in profile modal if OMEMO's not enabled 2018-08-21 18:03:34 +02:00
JC Brand
9a7f56db7d Fix format of stanza that queries for devices. 2018-08-19 10:09:43 +02:00
JC Brand
4ed43854bd Bugfix. Items need to go inside the list 2018-08-18 18:25:52 +02:00
JC Brand
2884549bb3 Test decryption of incoming OMEMO message
updates #497
2018-08-04 23:49:01 +02:00
JC Brand
713f49453f Working example of AES-GCM encryption and decryption
with key import and export.

updates #497
2018-08-04 21:32:08 +02:00
JC Brand
f2c283c907 More work on decrypting messages 2018-08-04 19:41:06 +02:00
JC Brand
be0eaecff9 Parse incoming OMEMO encrypted messages 2018-08-04 09:26:23 +02:00
JC Brand
b273d00412 Fix failing tests due to api refactor (returning promises) 2018-08-04 08:39:14 +02:00
JC Brand
e774e9d1af Test that own devices (from other clients) get included
when sending out encrypted messages.

updates #497
2018-07-28 16:36:56 +02:00
JC Brand
a3593dbc7d Implement and test sending of encrypted messages
updates #497
2018-07-28 15:37:36 +02:00
JC Brand
bcd6845756 Show fingerprints in the user details modal
updates #497
2018-07-25 11:33:16 +02:00
JC Brand
114e46dfab Fix broken test and refactor slightly. updates #497 2018-07-22 10:33:57 +02:00
JC Brand
b80a77a21c Include signedPreKeySignature in published bundle
updates #497
2018-07-21 21:53:31 +02:00