This change reverts the significant part of 1dfdb36d20
I can't say that I understand why libsignal throws `Error: Invalid signature`
when you try to build a session for your own (sending) device, but given that
messages can only be decrypted once, I guess it isn't really necessary
to encrypt for your own device, since you already have the plaintext.
In addition I've added some error handling so that we can recover
gracefully when session building fails for a subset of devices.
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.
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.
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.
- 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
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
`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.
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
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.
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