Commit Graph

486 Commits

Author SHA1 Message Date
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
JC Brand
2133241998 CSS: Fix chat title width and elipsis color
in overlayed view mode.
2022-03-10 20:51:04 +01:00
JC Brand
e52056bb33 Refactor the emoji-picker somewhat
Trigger an `emojiSelected` event instead of manually calling `insertIntoTextArea` on the `converse-message-form` a component.
This loosens the coupling between the emoji picker and `converse-message-form`.

Call `disableArrowNavigation` when the emoji-picker is disconnected from
the DOM or when escape is pressed. See #2754
2022-03-09 12:44:33 +01:00
JC Brand
c42bd90c9d Don't clear textarea on escape, unless we're correcting a message 2022-03-09 11:24:32 +01:00
JC Brand
b248803a4b Fixes #2822 2022-02-20 19:17:52 +01:00
JC Brand
7b63b7b30f Make various error messages ephemeral.
Also make it possible to specify the timeout for an ephemeral message.
2022-02-19 23:11:22 +01:00
JC Brand
ca20f687bf minimize: initialize chat via event instead of override 2022-02-19 23:10:17 +01:00
JC Brand
bbef09346a Various CSS fixes and use converse-icon for nav button 2022-02-19 23:09:39 +01:00
JC Brand
1c8085f00e CSS: Set modal header color for error alerts
Also fix various element colors for Dracula theme
2022-02-19 21:32:25 +01:00
JC Brand
39e9ed8fe4 Updates #2733
Rather use `false` for a bool
2022-02-15 14:48:01 +01:00
JC Brand
22a7e1b35f Updates #2733
Set `is_error` to back to undefined
2022-02-15 14:46:00 +01:00
JC Brand
9a95c2d048 Normalize URL path
Udates #2814

Otherwise `"` gets escaped as `"` by lit-html which is not correct.
2022-02-15 14:38:40 +01:00
JC Brand
9a2424fa26 Fixes #2814. Links are mangled on open/copy 2022-02-15 14:10:40 +01:00
JC Brand
b44e1c82f0 Updates #2733
- Clear timer when a messages changes from epehemeral to non-ephemeral
- Set MUC occupant on `groupchat` message when `type` changes to `groupchat` (from `error`)
- Set roster contact on `chat` message when `type` changes to `chat` (from `error`)

Thanks @afriedmanGlacier
2022-02-15 12:23:46 +01:00
JC Brand
a07bd7c817 Use SVG icons for refresh button and toggle switch 2022-02-15 11:17:41 +01:00
JC Brand
85d75a5494 Fixes #2745. Wraps MUC details in converse-rich-text
Also fixed an issue where the `config` model on the MUC wasn't being
properly persisted and fetched.
2022-02-15 11:17:33 +01:00
JC Brand
7c7b667745 MUC: Register handler to parse for commands in the plugin index.js 2022-02-14 15:17:05 +01:00
JC Brand
38519a6261 Updates #2733
Properly handle the same OMEMO message being recieved twice, with the
2nd one failing to decrypt.
2022-02-14 12:59:49 +01:00
JC Brand
f6c524f760 Move MUC modals to the muc-views plugin 2022-02-14 12:59:49 +01:00
JC Brand
7f40d1a2f2 Fix #2627 2022-02-10 13:36:22 +01:00
JC Brand
066d29d637 Fix alignment of close button for MUC sidebar 2022-02-10 12:09:02 +01:00
JC Brand
12a2354d9e CSS: Fix chat heading colors 2022-02-09 21:38:30 +01:00
JC Brand
d8f6a16936 Avoid unnecessary call to requestUpdate and use updateComplete 2022-02-09 21:22:38 +01:00
JC Brand
f4fdc36d31 Add modal for changing your nickname...
once you're already in a MUC.
2022-02-09 20:05:30 +01:00
JC Brand
ba52defdae Move nickname tests into a new file 2022-02-09 20:05:30 +01:00
JC Brand
505416a59e Let bookmarks be created/removed via a modal 2022-02-09 20:05:30 +01:00
JC Brand
9d250c3cbf Fix failing test due to converse-icon being used 2022-02-09 20:05:30 +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
bef2cbb462 Use SVG icons and tweak message padding 2022-01-31 23:00:26 +01:00
JC Brand
8dcacd41bf Add hover color for svg icons 2022-01-29 12:12:36 +01:00
JC Brand
dd539c7675 CSS: fix unread msgs indicator in Dracula theme
Also try to create some initial structure with the CSS properties to
make theming easier
2022-01-29 11:19:00 +01:00
JC Brand
818ad0955a Add ability to switch between dark and light modes 2022-01-28 21:20:12 +01:00
JC Brand
ac473fd297 Add dark theme Dracula
https://draculatheme.com
2022-01-28 20:28:48 +01:00
JC Brand
7c51147023 Use the parseMessageForCommands hook to also parse MUC commands
Also fix issue where `model.getAllowedCommands()` prevents 3rd party
implementations.
2022-01-28 12:40:21 +01:00
JC Brand
003a90c71c Don't explicitly trigger the hook parseMessageForCommands
inside `parseMessageForMUCCommands`.

If the function doesn't find any core MUC commands, it calls
`parseMessageForCommands` which will trigger the hook.

I think it's appropriate to give built-in commands preference above
commands by 3rd party plugins and this also solves the issue of the hook
being triggered twice (once in `parseMessageForMUCCommands` and
then again in `parseMessageForCommands`).
2022-01-27 19:12:35 +01:00
JC Brand
d06761e2a8 Fix failing tests 2022-01-27 19:12:35 +01:00
Dele Olajide
c83cc69cef Implement new hook parseMessageForCommands for plugins to add custom commands 2022-01-27 14:34:20 +01:00
JC Brand
351212cd13 Move webpack files into dir 2022-01-27 13:08:40 +01:00
JC Brand
e9ae5306e3 Bugfix. Avoid calling this.authenticate twice in one method 2021-12-11 12:28:04 +01:00
JC Brand
048560908e Login form: Allow user to choose the connection URL
if `websocket_url` and `bosh_service_url` are not set and XEP-0156
lookup was unsuccessful.
2021-12-10 22:57:33 +01:00
JC Brand
0dee9897dd Use CustomElement instead of ElementView for login form 2021-12-10 22:57:33 +01:00
JC Brand
a673086941 Rename loginpanel to loginform
Run prettier and move constants to `constants.js`
2021-12-10 22:57:33 +01:00
JC Brand
c81841e036 Fix margin issues at different viewport sizes 2021-11-26 09:52:52 +01:00
JC Brand
3d74ed31c2 Fixes #2683, Updates #1317 2021-11-24 22:44:02 +01:00
JC Brand
1a6a7ade73 Fixes #2715 2021-11-24 21:52:40 +01:00
JC Brand
284eccf047 Create converse-omemo-profile component
Removes the need to override the ProfileModal
2021-11-24 21:14:11 +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
2af758e66d Not sending headers with upload request
Fixes #2728
2021-11-21 11:56:53 +01:00
JC Brand
fa562cabae Don't fetch member list if not affiliated
Fixes #1426
2021-11-21 11:05:23 +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
afbb46bd8c Add converse-image custom element
And use that to render images in unfurls.

This solves the issue of github URL unfurl images not having an image
extension and then being rendered as a hyperlink by `converse-rich-text`.

Instead, we know that it's supposed to be a url, so we just use `converse-image`.
2021-11-19 22:32:46 +01:00
JC Brand
35947e3d62 Show avatars in MUC occupants sidebar
Fixes #1322

(Also clean up some loose threads)
2021-11-19 21:08:51 +01:00
Andy Friedman
c76e6fb86b Compress new avatar images 2021-11-19 13:01:09 +01:00
JC Brand
664f290001 Use converse-avatar for setting avatar 2021-11-19 13:01:09 +01:00
JC Brand
c62ea03e2e Use converse-avatar for roster items 2021-11-19 13:01:09 +01:00
JC Brand
8db12e61bf Use converse-avatar and fix bug...
where avatar didn't show in 1:1 chat heading (due to a race condition)
2021-11-19 11:07:09 +01:00
JC Brand
a5b73f0309 Create the converse-avatar custom element 2021-11-19 10:00:04 +01:00
JC Brand
e347621dc8 Add JSDoc example 2021-11-17 09:42:38 +01:00
JC Brand
1ee75b78b7 Replace more font icons with svg icons
Updates #1004
2021-11-14 22:53:04 +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
John Spurlock
1c6ada4af8 Fix send button not working in a muc room
Was looking at the wrong form
2021-10-30 21:16:11 +02: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
90d93b364a Reregister nick when changing it in a members-only MUC 2021-10-30 20:56:23 +02:00
JC Brand
1b31e80f25 Render MEP message reason as rich text 2021-10-21 10:43:24 +02:00
JC Brand
d2a33bc210 Add the ability to retract XEP-0316 MEP messages 2021-10-20 17:49:58 +02:00
JC Brand
3cfdf4c946 Fix trimming of chats in overlayed view mode 2021-10-14 17:49:20 +02:00
JC Brand
5a7f16b6f9 Bugfix. 'closed' value only relevant in overlayed view mode 2021-10-14 16:15:17 +02:00
JC Brand
32e521fdc7 Bugfix. MEP messages appear at bottom when returned from MAM 2021-10-13 21:14:57 +02:00
JC Brand
521f3d88d2 Move MUC MAM tests into a new file 2021-10-13 20:01:09 +02:00
JC Brand
6cff47c6d8 Remove muc_ogp_show_unfurls setting
And instead use the `render_media` setting to determine whether unfurls
should be shown.
2021-10-01 13:22:17 +02:00
JC Brand
366932e999 Allow render_media setting to be an array of domains
This allows for more flexibility in configuring which media URLs will
automatically render and which media URLs may be manually rendered by
the user (via the message actions dropdown).

For example, suppose you want to automatically render all media URLs
from https://xmpp.org, but still allow other media (which won't render
by default) to be rendered manually by the user (by clicking the "Show
URL previews" message dropdown action).

In this case, you set `render_media` to `['xmpp.org']` and
`allowed_image_domains` to `null` or `undefined`.

Or if you want to automatically render images from xmpp.org, and
restrict the domains users might manually click to render, you can add
those extra domains to `allowed_image_domains`.
2021-09-30 16:30:30 +02:00
JC Brand
1809e38911 Move isUniView function to utils 2021-09-29 12:03:21 +02:00
JC Brand
06ec539839 Update lit imports 2021-09-29 11:20:14 +02:00
JC Brand
84c6a0039c Fix embedded, singleton mode.
It's now necessary to add a `converse-root` element in the DOM where you
want Converse to render (previously it was any element with the id
`#conversejs`).

Also, turned `converse-chats` element into a Lit element and re-render
`converse-root` and `converse-chats` when the `view-mode` or `singleton`
settings change. This is a step towards being able to change the view
mode on the fly and have the entire chat re-render appropriately.

Fixes #2647
2021-09-24 11:53:49 +02:00
JC Brand
5ff57258ec Fix nickname form width 2021-09-23 22:31:30 +02:00
JC Brand
881a9a6d27 Re-render message if relevant config settings change 2021-09-23 21:50:24 +02:00
JC Brand
48f37aa1c0 Call initialize in CustomElement's connectedCallback method 2021-09-23 14:25:42 +02:00
JC Brand
7f2ab05f97 Move tests to separate file 2021-09-22 16:45:57 +02:00
JC Brand
05dcb4e8d7 Breaking change: stop setting config variables on the _converse object 2021-09-21 17:08:30 +02:00
JC Brand
efafc2d691 Allow media to be invidually shown/rendered...
even if the global configuration is to disallow it.

* When parsing, include all media URLs, not just the ones from allowed domains.
  That makes it possible to change allowed domains on-the-fly,
  while still allowing media in individual messages to be shown manually
  (via the message actions dropdown).
* Merge `embed_audio`, `embed_video` and `show_images_inline` into `render_media`
* Create new config settings for allowable domains for images, video and audio
* Check the URL domain against a whitelist for the message actions dropdown
2021-09-21 17:08:30 +02:00
JC Brand
ed490fc202 Create directory for modal plugin 2021-09-20 11:13:26 +02:00
JC Brand
75fee76693 Fixes #2650 2021-09-14 22:27:49 +02:00
JC Brand
caffcaaef2 Move occupant-related tests into new file 2021-09-14 22:03:10 +02:00
JC Brand
906a606010 Get rid of unnecessary specificity and functions 2021-09-09 11:35:00 +02:00
JC Brand
ef2c206507 Fix failing test 2021-09-09 11:12:31 +02:00
JC Brand
b78c19f6f2 Fix showing of HTML5 notifications for MEP messages 2021-09-08 17:30:30 +02:00
JC Brand
8f34065fc0 Also create MEP messages received from a MAM archive 2021-09-08 10:22:26 +02:00
JC Brand
f40a8f69ae Don't show minimized chats when logged out 2021-09-06 22:08:36 +02:00
JC Brand
f04a376653 Fixes #2628: Open bookmarks toggle emits an error 2021-09-06 21:29:35 +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
5095027a0b Don't render OOB url if it's the same as the body
Otherwise the file gets shown/rendered twice.
2021-09-01 10:35:32 +02:00
JC Brand
5dc89fb2b3 Ignore 'minimized' flag when not in overlayed view mode 2021-08-31 12:11:27 +02:00
JC Brand
90ea092e4d Register a XEP-0316 MEP handler
Add caps element to the MUC join presence, so that the MUC MEP node can
know whether we're interested in receiving MEP messages.

Create info messages for any `conference-info` tags that contain `activity` tags.

Check for both `headline` and `normal` MEP messages (even though the XEP
only show `headline` examples), since `normal` messages can be archived
in MAM, but `headline` ones not.

Update the XEP-0372 reference-parsing code to take the `anchor`
attribute into consideration, specifically to check which text element
the reference applies to.

Add support for rendering XEP-0372 mentions in "info" messages and for
triggering HTML5 Desktop notifications for such mentions.

Background:
-----------

XEP-0316 describes a way for a MUC to send out PEP-like messages to MUC
participants. This feature can be used to describe custom activity happening
in the MUC.
2021-08-31 11:23:49 +02:00
JC Brand
6827e21df1 Fix race conditions in tests 2021-08-31 11:23:49 +02:00
JC Brand
0c0af2d00b Fix the minimized chats toggle
Clicking didn't make the minimized chats appear.
Also turn it into a Lit component
2021-08-29 00:15:45 +02:00
JC Brand
6c3a3dd1d3 Fix background for overlayed mode 2021-08-29 00:15:45 +02:00
JC Brand
8eac031047 Re-add wrapper anchor for unfurl images
We don't want the wrapper for interactive elements (GIF, video, audio),
but for images we still want them to link to the unfurled URL.
2021-08-10 13:45:56 +02:00
JC Brand
610e334bed Use converse-icon in the modtools modal 2021-08-06 13:38:12 +02:00
JC Brand
44a573b6c4 Handle GIFs inside Unfurls
- Add ability to play/pause by using `converse-rich-text`
- Make `converse-rich-text` component configurable whether the media URLs for GIF/audio/video are shown
- Add fallback options for GIFs that have errors
2021-08-03 12:14:13 +02:00
JC Brand
d0627f800c Clear unread message counters when chat becomes visible 2021-07-30 09:56:17 +02:00
JC Brand
106cde9262 Update modtools component...
to accept jid and affiliation and to not use a Model to store state
2021-07-28 13:28:01 +02:00
JC Brand
0242fdb020 Extract moderator tools functionality and put it in a component
This makes it easier for 3rd parties to embed it in other modals (besides the bootstrap modal).
2021-07-27 12:53:39 +02:00
JC Brand
10c610232c Use converse-icon instead of webfonts in heading dropdown 2021-07-27 11:11:36 +02:00
JC Brand
c961615609 Move converse-dropdown styles in separate file
And add some tweaks
2021-07-27 10:53:23 +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
0ccf25d986 Add support for controlling (e.g. pausing, looping) gifs
- Create new component `converse-gif`
- Draw gif in canvas and add controlls
2021-07-23 19:31:43 +02:00
JC Brand
316748988b Allow contact's profile modal to be shown...
even if there is now OMEMO device info
2021-07-23 18:30:07 +02:00
JC Brand
5cce34eb40 Split push plugin up into multiple files 2021-07-19 16:40:40 +02:00
JC Brand
60826ac6c6 Move functions out of core.js 2021-07-19 16:40:40 +02:00
JC Brand
d1abf3a04e Wait for roster to be initialized 2021-07-19 16:40:40 +02:00
JC Brand
d2a35d4ce1 Turn converse-roster and converse-roster-filter into Lit elements 2021-07-15 17:26:09 +02:00
JC Brand
8de4671603 Replace more elements that use font icons with svg icons 2021-07-15 16:28:12 +02:00
JC Brand
2bcf01f5ab Use DOMPurify instead of XSS.js
Remove exports-loader, which is therefore no longer necessary
2021-07-15 14:16:41 +02:00
JC Brand
f2aa39e1c3 Identify media URLs during message parsing 2021-07-06 13:35:22 +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
3d8852950d Add ability to let dropdown appear at the top, left-aligned
And use that for the last message in the chat history, otherwise the
dropdown is obscured.
2021-07-01 15:23:37 +02:00
JC Brand
e675c853f3 Add XEP-0454 support for encrypting files
Fixes #1182
2021-07-01 14:35:48 +02:00
JC Brand
6665bef76c Fix failing tests
Handle missing message model (happens during tests)
2021-06-29 16:00:10 +02:00
JC Brand
dff5f485c9 Split out MUC tests 2021-06-29 15:59:49 +02:00
JC Brand
4047d619a1 Remove lodash dependency in tests 2021-06-29 15:59:49 +02:00
JC Brand
767d5ec91d fix failing test 2021-06-29 15:59:49 +02:00
JC Brand
335a491e0d Stop using the Jasmine "done" callback 2021-06-29 15:59:49 +02:00
JC Brand
8506646db2 Remove unnecessary event trigger 2021-06-29 12:57:48 +02:00
JC Brand
be329a2d10 Don't subclass the chatbox for the controlbox model 2021-06-29 12:55:29 +02:00
JC Brand
14020125b9 Remove sinon and bump npm 2021-06-25 11:21:17 +02:00
JC Brand
0f82b76c09 fix failing test due to i18n string change 2021-06-25 10:59:13 +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
JC Brand
92093d6d28 Further style tweaks for embedded media 2021-06-24 13:04:25 +02:00
JC Brand
e00bf3da36 Make sure unread messages are cleared when showing a chat 2021-06-23 17:18:32 +02:00
JC Brand
9e21813251 Move tests into new file 2021-06-23 17:11:13 +02:00
JC Brand
629f382642 converse-roster: Move functions to utils 2021-06-23 12:02:47 +02:00
JC Brand
ad96db994e Fix failing tests on Travis 2021-06-23 10:52:32 +02:00
JC Brand
958d98a1a1 Use mock method in test 2021-06-22 17:04:27 +02:00
JC Brand
fb6bafdf6c Styling: Fix an offset bug
That caused empty inline code hints to be considered valid.

Also update the tests that were failing due to the changes in the
previous commit.
2021-06-22 16:54:05 +02:00
JC Brand
6dea5959cc Use API to get chat/room models in components 2021-06-22 14:47:35 +02:00
JC Brand
afd737f965 Fixes #2520 2021-06-22 12:50:50 +02:00
JC Brand
8de6e78729 In converse-muc-chatarea, use API to get room
and handle asynchronicity.
2021-06-18 11:56:35 +02:00
JC Brand
619fb538d7 Show video download URL 2021-06-17 15:50:10 +02:00
JC Brand
095d9b60cd Render audio from URLs in messages 2021-06-17 15:24:25 +02:00
JC Brand
33b426c79e Render videos from URLs in messages 2021-06-17 14:06:18 +02:00
JC Brand
2ac49fb9a5 Bugfix. Images being rendered when they shouldn't 2021-06-17 14:06:18 +02:00
JC Brand
b071a0e22f MAM: Prevent multiple simultaneous queries when scrolling up 2021-06-17 11:39:20 +02:00
JC Brand
b6f2662ad7 Set 'scrolled' flag on model.ui
This prevents it from being persisted across page loads and makes more
sense logically.

Also move markScrolled to utils and MUC unread messages indicator to bottom panel.
2021-06-17 11:39:20 +02:00
JC Brand
dc711d494f Add a placeholder to indicate a gap in the message history
The user can click the placeholder to fill in the gap.
2021-06-17 11:35:06 +02:00
JC Brand
bbc952b265 Fix MUC and headlines heaidngs, so that they still work
as ElementViews, since I ran out of time converting them to lit
components as well.

This reverts commit 1121a90af0.
2021-06-15 11:09:34 +02:00
JC Brand
1121a90af0 Revert "Turn heading into a lit component"
This reverts commit 969b2f2e11.
2021-06-15 10:52:17 +02:00
JC Brand
969b2f2e11 Turn heading into a lit component 2021-06-15 10:33:33 +02:00
JC Brand
8907adc236 Move method to utils 2021-06-15 10:03:10 +02:00
JC Brand
c8304497b5 Remove onStatusMessageChanged handler
It's no longer necessary and calls a method that doesn't exist anymore.
2021-06-15 09:59:40 +02:00
JC Brand
68f0be996f Let chats be closed by calling close on the models
Instead of on the views/components.

We still have `close` methods on the components, but they are just
event handlers and not external API methods to be called by other code.
Instead `close` should be called on the model.
2021-06-15 09:59:40 +02:00
JC Brand
9fb92080f2 Get rid of the APIs to fetch chat views
This is largely a leftover from the Backbone.View days and makes less
sense now that the UI is componentized.

Ideally we don't want to call commands on the "views themselves, instead
we should be working on the the models and let the "views" update
themselves automatically.

Also, given that the `jid` attribute on the chat views might change,
especially when rendered declaratively in other frameworks like React,
a view might not be available at times where we previously might have
expected it to be (since it's been repurposed for a different JID).
2021-06-15 09:59:40 +02:00
JC Brand
54d6a6af56 Unfurls: gracefully handle missing OGP data 2021-06-09 20:54:08 +02:00
JC Brand
825e2643ae Use flex-direction: column-reverse
On the `<converse-chat-content>` element. This removes the need for all
the manual scrolling.

Firefox finally supports this feature. Unfortunately Firefox ESR doesn't
yet, but I can't wait anymore.
2021-06-07 19:26:16 +02:00
JC Brand
9bcf5f2947 Scrolling fixes
* Remove extra `_markScrolled` function
* Only try to maintain scrolling position when some non-scrolling change has happened.
2021-06-07 17:54:38 +02:00
JC Brand
c966c49304 Fixes #2500
This wrongly stored value wasn't inlcuded in the published the bundle
because the libsignal store was used, which had the right value for the public key.

Instead, this value was used locally by being passed to the libsignal
session builder to verify signed prekey.
2021-06-07 13:49:21 +02:00
JC Brand
90dff612c7 Re-initialize chat components when jid attribute changes 2021-06-07 12:53:35 +02:00
JC Brand
e3612e8c62 Turn the chats into Lit components
Previously they were of type ElementView from @converse/skeletor

The ElementView component is merely a helper to allow us to eventually
migrate everything to Lit
2021-06-04 15:22:52 +02:00
JC Brand
06c4ded063 Get rid of impperative code to render help messages
in 1:1 chat
2021-06-04 13:41:01 +02:00
JC Brand
982586b0e6 Move protocol tests to plugin 2021-06-04 12:53:03 +02:00
JC Brand
ae5a13bb06 Move emojis tests into plugins 2021-06-04 12:53:03 +02:00
JC Brand
f3efbba26c Create converse-message-form component
More work on making bottom panel sub-components declarative

- Handle auto-completion in the converse-muc-message-form element
- Make message limit indicator a component
- Rename template
2021-06-04 12:53:03 +02:00
JC Brand
623deac3ec Fix race condition in test 2021-06-03 18:36:26 +02:00
JC Brand
58d96c8594 Use intersection observer to remember scrolling position 2021-06-03 18:24:55 +02:00
JC Brand
279a3c3413 Add saveScrollPosition method on ChatContent 2021-06-03 15:32:39 +02:00
JC Brand
fe3e63d8c5 Declarative scrolling and rendering new messages indicator
- Increment `num_unread` when new messages appear while scrolled up
- Set scrolling state in model code (as opposed to view)
2021-06-03 14:16:03 +02:00
JC Brand
ec93e2fff3 Render chat messages loading spinner declaratively
instead of imperatively.

Add new non-persisted UI model for rendering UI changes. Currently only
being used for rendering the spinner
2021-06-03 00:02:33 +02:00
JC Brand
59d55b3526 Add option to deregister nickname when closing a MUC
By setting `auto_register_muc_nickname` to `'unregister'`
2021-06-02 22:06:57 +02:00
JC Brand
0756af2b30 Refactor chat close methods
- Remove the shared base-class method.
- Trigger `chatBoxClosed` on the model
- Send CSN from the model, not the view
2021-06-02 17:55:52 +02:00
JC Brand
1598640c80 Remove line-breaks from message image markup
We use `white-space: pre-wrap` to render the messages, so line-breaks in
the markup add unnecessary space.
2021-06-01 14:56:43 +02:00
JC Brand
994e528b45 Bugfix. Properly escape | character in mentioned nicknames 2021-05-19 14:47:20 +02:00
JC Brand
06f03fc884 MUC: Store disconnection data on the session 2021-05-13 15:45:12 +02:00
JC Brand
698f3a7b15 Bugfix. Can't call tagName on a Strophe.Builder object 2021-05-13 14:41:44 +02:00
JC Brand
ad53a3c9a1 Message styling fix
Don't parse text that falls within XEP-0372 references ranges for
message styling hints.
2021-05-13 11:20:03 +02:00
JC Brand
58b59fe263 Move more tests from spec folder 2021-05-12 12:41:19 +02:00
JC Brand
d71ab6d30d Bugfix. Need to pass in group name since this is undefined 2021-05-12 12:26:16 +02:00
JC Brand
2b12f8e257 Use lodash-es everywhere 2021-05-12 12:14:28 +02:00
JC Brand
f40bbbf145 Turn status plugin into folder
Remove the use of an override and add a hook `presenceConstructed` instead
2021-05-11 17:04:15 +02:00
JC Brand
1fc44b9d8e Turn caps plugin into folder.
Move more test files to plugins
2021-05-11 16:18:34 +02:00
JC Brand
c8f0406c84 Refactor bookmark plugins
Mainly moving functions and methods to utils
2021-05-07 12:27:29 +02:00
JC Brand
18e3b618b4 Some light chat views refactoring
- Move `showModeratorToolsModal` method from view to utils
- Move `getNicknameRequiredTemplate` method from view to utils
- Move common `close` code to base class
2021-05-07 11:23:52 +02:00
JC Brand
fdc81fa4ea Use .conversejs instead of .converse-root
as the class that designates standalone Converse components.
2021-05-06 12:21:35 +02:00
JC Brand
d0594a6bfc Add new test for <converse-muc> 2021-04-30 18:01:53 +02:00
JC Brand
9c11e0dc32 Use .converse-root class instead of #conversejs id 2021-04-30 17:36:42 +02:00
JC Brand
4bdafb8ea3 Break Sass up into more files
And import where appropriate to allow for custom builds that are still styled properly
2021-04-30 17:36:40 +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
Shaun Wu
1cb2b1f7a9 Adding configurable url history changing 2021-04-29 11:59:28 +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
1f7fecab21 Make show_images a prop of converse-chat-mesage-body
That way, when the setting changes and we call `requestUpdate` on
`converse-chat-message`, the body will rerender.
2021-04-26 12:08:16 +02:00
JC Brand
d86f3094b9 Fix failing test 2021-04-23 12:05:30 +02:00
JC Brand
8e0701f7bb Fix TypeError
The view isn't yet defined when we call `maybeFocus`. This is in any case
not the right place to call something like this.
2021-04-23 11:49:45 +02:00
JC Brand
a5d428c42d Fix closing MUC from rooms list
View isn't defined if chat is in background
2021-04-23 11:42:30 +02:00
JC Brand
7b49296a24 Bugfix. Avoid creating an undefined store 2021-04-22 14:47:01 +02:00
JC Brand
b678df8d23 Move tests file to plugin folder 2021-04-22 14:41:17 +02:00
JC Brand
458c51b32d Move tests for message image rendering to new file 2021-04-21 12:06:10 +02:00