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`.
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
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
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.
The issue was that batched writing was incorrectly also being applied
for sessionStorage stores, so when the `active` flag in
`_converse.session` was being set to `false` on window unload, the
change wasn't persisted before the window was unloaded.
This caused a new session to be created upon reload, thereby losing the
SMACKS data.
We already solved this for persistent stores by flushing them, and
doing so for the session stores would also work, but session stores
don't have to be batched in the first place, so we turn that off.
It's the only way I could get a failing test (due to the Jasmine upgrade AFAIK) to pass.
I don't understand why this happens, given that the promise has a
`catch` clause in `retractOwnMessage`, but for some reason the promise
rejection gets caught by Jasmine, causing the test to fail.
The disco entities collection gets recreated and repopulated every time
the connection is re-established or after the user logs in again after
having logged out.
The old disco entities weren't being removed, due to an erroneous
`shouldClearCache` call (not applicable to sessionStorage data).
In addition we need a handler to fire and clear the entities cache when
Converse is going to restart.
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.
If set to a positive integer, the chat history will be kept to that size
by removing older messages.
This happens as new messages come in (as long as the chat isn't scrolled up)
and when the user scrolls down.
Also add the `pruning_behavior` setting
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
This causes an empty bookmarks list in the controlbox, because the
collection gets cleared (and then asynchronousy repopulated) while the
`bookmarksInitialized` promise stays `true` (resulting in a race
condition).
Alternative fix could be to clear the bookmarks and recreate the promise
before reconnecting but doesn't seem necessary to do all that work.
This required triggering the `converse-loaded` event in the entry.js
file, which means it won't be triggered for `@converse/headless` when
used in isolation.
Not ideal, but probably ok because consumers of `@converse/headless`
should probably import it into their own project in any case.
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
- 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
when creating occupant from affiliation change stanza.
This means that when a presence for that occupant arrives, a duplicate
occupant is created (presumably because the original can't be find due
to the wrong nick being set).
- Move top-level functinos to utils files
- Get rid of unused/obsolete overrides
- Only import components there where they're used
- Bump version in package.json
Update storing of app settings. Store settings in a closured
`app_settings` object inside `@converse/headless/shared/settings`
Remove the `_converse.settings` object.
Url parameters mean that we don't get a match even when the URLs
actually match.
Could potentially use URI.js but gets cumbersome and since we restrict
to metadata coming from the MUC service (which we trust) I think it's OK
to remove it.