Commit Graph

1387 Commits

Author SHA1 Message Date
JC Brand
e80afbfe39 Move MUC and stanza utils into shared and plugin-specific files 2020-12-14 16:30:13 +01:00
JC Brand
2f244da8b1 Fix failing test 2020-12-11 14:06:37 +01:00
JC Brand
b771827d2a Fix corrections tests 2020-12-10 17:13:40 +01:00
JC Brand
af2df84fc1 Styling: Fix offsetting of mentions mixed in with styles 2020-12-09 18:05:08 +01:00
JC Brand
8572c86941 Styling: Trim leading whitespace inside blockquote
As demanded by XEP-0393
2020-12-09 15:11:54 +01:00
JC Brand
58586ab2e4 Styling: quotes should start on newlines
And when nested, have no spaces between them.
2020-12-09 14:19:31 +01:00
JC Brand
e3ebde9741 Move converse-chat plugin into folder 2020-12-07 16:30:11 +01:00
Xavi Ferrer
f4b6b93b8b update info messages visibility 2020-12-03 11:45:25 +01:00
JC Brand
160ab3452e Rename ids of two modals 2020-12-03 11:43:04 +01:00
JC Brand
1a161ad2c7 Add api for managing modals
Set passed-in properties on modal
2020-12-03 11:36:02 +01:00
JC Brand
b18cc6bcc5 Move modals and their templates into ./modals/ 2020-12-03 11:02:35 +01:00
JC Brand
5a3aaeb056 Prevent default when opening chat via xmpp: URI 2020-12-03 10:45:08 +01:00
JC Brand
01ee942920 Styling fixes
* Calculate proper length for :geo URI matches
* Don't strip out line-break after quotes, instead use CSS `display: inline-block`
2020-12-01 10:21:21 +01:00
JC Brand
c608958eb3 Handle special case of two @ signs preceding a nickname 2020-11-27 22:06:22 +01:00
JC Brand
f86efca9a6 autocomplete: Use regex instead of hardcoded list...
to determine valid characters to form a boundary before an `@` mention

Also fixed an issue with mentions looking like they're part of URLs, by
first processing mentions separately.
2020-11-27 22:06:22 +01:00
Xavi Ferrer
8b9c97745f Allow selected characters to precede a mention 2020-11-27 14:12:29 +01:00
JC Brand
35db01d316 Styling: Take offset into consideration when adding templates 2020-11-27 11:12:19 +01:00
JC Brand
30e784b8ec Fix: use_system_emojis was false but unicode emojis shown in picker 2020-11-27 10:26:06 +01:00
JC Brand
c002600ac5 Rename update_title setting to show_tab_notifications 2020-11-25 16:30:52 +01:00
JC Brand
fb316ff010 Styling: Remove line-break at end of blockquote
since the DOM element breaks the line already
2020-11-25 16:12:00 +01:00
JC Brand
f9650f33be Add support for XEP-0393 message styling
Fixes #1083

Directives are rendered as templates and their bodies are MessageText instances.
We thereby achieve the necessary nesting of directives (and other rich
elements inside directives) by letting each directive
body render itself similarly to how the whole message body is rendered.
2020-11-24 16:06:48 +01:00
JC Brand
7ae2b48da9 Move /me message tests to own file
Test mention inside a /me message
2020-11-24 16:06:48 +01:00
JC Brand
4e3a81d697 Fixes #2337
Newly opened headline chat isn't hidden by default in fullscreen view

Also include some CSS fixes for fullscreen headlines boxes
2020-11-19 13:20:02 +01:00
bernard-ng
08684a7c51 Fixes #2277 Show nickname conflict error 2020-11-18 11:23:46 +01:00
JC Brand
8a857e39f4 Move tab update to notification plugin
Updating tab notifications is not something that should be done in the headless part of Converse.
Don't update the tab title, having a favicon is enough.
2020-11-18 10:42:31 +01:00
Ariel Fuggini
6de07c5c29 Adds setting to toggle showing unread message counter in page title 2020-11-05 14:27:10 +01:00
JC Brand
4f7ff1f3cf headlines-view: Update to match changes to the normal chat view 2020-10-29 11:10:55 +01:00
JC Brand
59e216ad34 muc: no need for message_queue...
since we create the `fetched` promise earlier
2020-10-29 10:36:28 +01:00
JC Brand
c750748b8d Only create new message models once messages have been fetched
Fixes #2241
2020-10-29 10:36:28 +01:00
JC Brand
fe17be24e0 spec/smacks: prevent two MUCs from being created 2020-10-28 14:52:25 +01:00
JC Brand
c08ee00fcd Enforce uni-view in headless code
When we're showing only one chat at a time, we want to make sure that
all other chats have their `hidden` flag set to `true`.

Previously this was done in chatboxviews, but given that we want to
render UI based on state, this should be done in the headless part of
Converse.

As a result of the changes, the `beforeShowingChatView` has been
removed.
2020-10-27 13:00:43 +01:00
JC Brand
d8852c6260 Fix race conditions in tests 2020-10-27 12:16:28 +01:00
JC Brand
ae7b29cb90 Move correections tests into a separate file 2020-10-23 16:41:29 +02:00
JC Brand
8c1e886af9 Fixes #2302 Bookmarks get duplicated on server push 2020-10-23 16:22:40 +02:00
Xavi
15f5b185c3
Fix message reorder issue after edit (#2300)
* keep message in place after edition by assigning previous message original timestamp
* update time displayed to keep current behaviour
* add test to check a message remains in the same position of the history after being edited
* briefly describe pr changes in changelog
2020-10-23 15:07:56 +02:00
JC Brand
19dc66900d Split the trusted setting into two new ones:
- `allow_user_trust_override`
- `clear_cache_on_logout`

The `persistent_store` setting can now also be set to `sessionStorage`

The `trusted` settings was in effect playing the role of two separate settings
and implicitly affecting a third ('persistent_store').

By breaking it up, we make things more explicit and allow for new
configurations. For example, clearing the cache on logout, while using
some kind of persistent store.
2020-10-20 11:29:03 +02:00
Bernard Ngandu
e49f97472a
#2280 notify changes to client on bookmark-update (#2287)
* notify changes to client on bookmark-update
* update XEP-115 caps verification string
2020-10-14 13:09:33 +02:00
JC Brand
48f119b673 MAM: use bare JID as by attribute for archive-id
in 1:1 chats.

See: https://xmpp.org/extensions/xep-0313.html#archives_id
2020-10-13 04:48:21 +02:00
ChaosKid42
c9ba42d0a0
regression of #1317: Don't show errors for CSI messages (#2276)
* regression of #1317: Don't show errors for CSI messages
* fix failing tests
2020-10-08 12:13:04 +02:00
Xavi
86c04b876b
Allow mention autocomplete to trigger right after a new line (#2267)
* catch all whitespace characters instead of just new line
2020-10-07 11:05:18 +02:00
Christoph Scholz
f68eb65cd7 check against own jid when detecting forged mam messages 2020-10-06 20:30:40 +02:00
Christoph Scholz
07f2f285ff Fix issue #2168 2020-10-02 12:07:48 +02:00
JC Brand
383b6a27c3 Render the brand heading as a component 2020-10-02 11:44:28 +02:00
bernard ng
efd4e50378
Fix #2231 add sort by query (#2234)
Use of lowercase letters and Infinity to avoid calculation errors when the index is -1
2020-10-01 12:06:35 +02:00
JC Brand
b5783c0668 Refactor converse-api.query and the RSM class
- The `converse.api.query` method now no longer accepts an RSM instance.
- The RSM class now separates `query` parameters from `result` attributes
- Improve JSDoc docs and remove need to make `converse-rsm` a plugin
- Add typedefs for the options expected by RSM and `api.archive.query`
2020-09-30 18:51:21 +02:00
JC Brand
65ad33ec81 Let message component listen for changes...
and render directly from those

Instead of doing it higher up in the chat view (which requires more
function calls and iterating through all messages).
2020-09-27 10:31:53 +02:00
JC Brand
5dac2d8873 muc-views: Use lit-html instead of lodash templates 2020-09-27 10:31:32 +02:00
JC Brand
0ca2e5ae08 Remove need for lodash templates in headless build 2020-09-26 09:58:34 +02:00
JC Brand
5350cb107f Don't throw timeout errors for sent IQ#result or IQ#error stanzas 2020-09-25 14:12:12 +02:00
JC Brand
3af1ffc357 omemo: announce bundle info after publishing new device 2020-09-18 15:09:55 +02:00
JC Brand
32847e860f pubsub: await IQ response when publishing 2020-09-18 15:09:23 +02:00
JC Brand
5949d29460 omemo: specify pubsub item id of 'current' 2020-09-18 15:09:23 +02:00
JC Brand
5d8e5468ba Refactor converse-notifications to used parsed message attributes
instead of querying the stanza.

Also fixes a bug where typing notifications triggered an AttributeError
inside `shouldNotifyOfGroupMessage`
2020-09-10 10:10:59 +02:00
JC Brand
2c042cc3fa Fixes #2184: Headless build relies on locale directory
Removed Jed from the headless build and instead let `__` call sprintf.

It's now up to downstream users for `@converse/headless` to decide
whether they want i18n support for the few translatable strings in that package
and to implement it themselves.
2020-09-10 08:55:38 +02:00
JC Brand
ffbab33a26 Create own occupant before setting connection_status to ENTERED
This makes it possible to wait for the connection_status before trying
to call `getOwnOccupant` in plugins
2020-09-09 15:33:50 +02:00
JC Brand
7c43d0435c Refactor OMEMO.
- Add hooks to the stanza parsers so that plugins can do additional parsing.
- Change ChatBox instance methods to functions and use them for stanza parsing.
- Move encrypt and decrypt messages to `converse.env.omemo`

Apparently, when receving a 1:1 carbon message, a device was wrongly created
for the contact's device list, instead of our own.
2020-09-09 14:04:24 +02:00
Ariel Fuggini
fce337e352 New configuration setting: notify_nicknames_without_references 2020-09-09 13:11:45 +02:00
Christoph Scholz
6319f566dd fix emojis in case use_system_emojis == false 2020-09-05 11:33:25 +02:00
JC Brand
c3d8f12050 Make api.user.status API methods async
So that `_converse.xmppstatus` is defined before trying to set the
status.
2020-09-04 13:13:07 +02:00
JC Brand
c41bdac6c8 Some work on componentizing the minimized chats UI 2020-09-03 13:06:17 +02:00
JC Brand
d5c93eb024 Create converse-root custom element
This element can be used to declaratively insert Converse into the DOM.

You can put `<converse-root>` into the DOM (e.g. by rendering it inside
a React component) before or afer Converse has loaded and/or has been
initialized.
2020-09-03 13:06:17 +02:00
JC Brand
ac31d41c85 Test string value for filter_url_query_params 2020-09-01 07:26:20 +02:00
Ariel Fuggini
3535d05ff5 Removes query params from urls as set in config 2020-09-01 07:12:52 +02:00
JC Brand
d83d0158e2 Properly test for show_images_inline 2020-08-31 21:02:07 +02:00
JC Brand
831a9fa224 Append .png to failed image URLs without extensions
Otherwise Imgur URLs don't render
2020-08-31 20:43:54 +02:00
Ariel Fuggini
6adec9a8d2 adds option to whitelist image domains 2020-08-31 20:38:09 +02:00
Ariel Fuggini
f88960c561 Added tests and documentation 2020-08-31 17:13:24 +02:00
JC Brand
8c799efc58 Don't minimize chats by clicking the header
This prevents the burger menu from opening
2020-08-24 11:28:48 +02:00
JC Brand
f7ef334fac Rename method to better describe what it does 2020-08-18 21:09:39 +02:00
JC Brand
6e86fe3300 Fixes #1913. Can't connect to non-ascii JID 2020-08-13 11:26:02 +02:00
JC Brand
09371712b0 Updates #1896: Properly identify archived one-on-one messages
Also, rename attribute from `is_receipt_request` to `is_valid_receipt_request` to avoid confusion.
2020-08-13 11:09:22 +02:00
Xavi
7cdc592ed9
merge only relevant settings when calling api.settings.extend (#2187)
* merge only relevant settings when calling api.settings.extend
* test behaviour is the one expected and change doesn't break previous tests
2020-08-12 10:12:10 +02:00
JC Brand
1898e7865d Move the MUC list modal to its own file 2020-07-28 13:07:33 +02:00
JC Brand
16ca8044f8 Add experimental support for running the XMPP conneciton inside a shared worker
Still lacks inter-tab communication to update state across tabs, i.e.
when sending a 1-on-1 message in one tab, it doesn't appear in another,
because that information is not available via the websocket connection.

- Create a new `Connection` class that extends Strophe.Connection and
    move related code from `converse-core.js` into this class.
- Store the session in localStorage when using a worker
- Move XEP-0156 code to connection.js
    This allows us to initialize the connection without needing to know the
    domain.
2020-07-27 12:43:47 +02:00
JC Brand
1419b4fc96 MUC: Add support for status code 333 2020-07-22 10:11:05 +02:00
JC Brand
0da8067129 MAM: Fix a MUC timing issue.
If a message comes in after joining the MUC but before the MAM messages
have been fetched, then converse-mam will query for MAM messages newer
than that message, causing an empty history (except for that one message).
2020-07-14 22:41:26 +02:00
JC Brand
91c130752c chatview: Scroll down on image load 2020-07-14 14:17:54 +02:00
JC Brand
282ffc622f Emoji picker fixes
- Don't replace entire textarea when entering a second emoji
- Focus emoji picker on tab completion when it's already opened
2020-07-14 11:38:00 +02:00
JC Brand
4de9816f24 Make sure emojis are initialized before parsing a message
for emoji related data
2020-07-13 15:45:37 +02:00
JC Brand
e6d8634194 Emoji picker: properly insert emoji upon click 2020-07-13 10:59:57 +02:00
JC Brand
756a85fb53 Emoji picker: make sure search results get properly updated 2020-07-13 09:55:01 +02:00
JC Brand
d0ba94e9df Replace lodash templates with lit-html 2020-07-09 22:08:23 +02:00
JC Brand
a014eca9e7 Add a renderImage directive which handles errors 2020-07-09 20:51:32 +02:00
JC Brand
8943609d10 Refactor the body directive
Changes how rich message markup is generated and kept track of.
We now have a MessageText class which subclasses String and which keeps
track of the rich markup associated with the message.
2020-07-09 20:50:25 +02:00
JC Brand
bb9ee4caab Enable all tests again 2020-07-09 11:15:28 +02:00
JC Brand
34c0c248be Move mentions tests into their own file 2020-07-08 14:32:06 +02:00
JC Brand
4bf823f6cd Fix show/hide of spoilers 2020-07-08 10:22:20 +02:00
JC Brand
c3d6b64f4b Turn the chat toolbar into a component
- Declaratively render the emoji picker dropup
- Got rid of converse-emoji-views
- Adapt OMEMO to the new buttons stuff
- Make emojis json global, to try and speed up tests
- omemo: Move functions to the top of the module
2020-07-08 10:17:06 +02:00
JC Brand
a36ba22676 Test message stanza with spoiler 2020-07-01 09:25:22 +02:00
JC Brand
f8efd94249 Don't smooth-scroll upon first appearance of the chat
it's annoying in overlayed view-mode where the user might be navigating
around the site.

Fixes #2091
2020-06-30 14:11:53 +02:00
JC Brand
9026062a32 Render chatbox message form via lit-html 2020-06-26 16:08:34 +02:00
JC Brand
22b2875b52 emoji-picker: Move picker content into another component
to avoid re-rendering them when non-relevant properties change
2020-06-25 14:31:01 +02:00
JC Brand
b3e34a0636 Turn the emoji picker into a web component 2020-06-25 10:27:29 +02:00
JC Brand
be20b8e1a0 emojis: fix rendering of custom emojis 2020-06-25 10:24:45 +02:00
Ariel Fuggini
77a0a01eff
Makes message with errors non-editable (#2089)
* Makes message with errors non-editable
2020-06-25 10:22:44 +02:00
JC Brand
b6dabf7381 muc: Ensure that exact nicknames (and not substrings) are matched 2020-06-22 13:57:44 +02:00
JC Brand
e2fbfa7470 modtools: Better error reporting 2020-06-22 13:13:44 +02:00
JC Brand
a31d245136 Update to eslint 7.3.0 2020-06-22 11:01:19 +02:00
JC Brand
0120f78c87 modtools: Don't show admin...
as assignable affiliation when the current user is an admin.

https://xmpp.org/extensions/xep-0045.html#affil-priv
2020-06-22 10:50:49 +02:00
Ariel Fuggini
73d33e1161
Makes mentions case-insensitive, plus parsing functionality refactor (#2061) 2020-06-18 11:19:01 +02:00
JC Brand
6b55907ddd Bugfix. Don't remove affiliated members on probe response
by checking for the affiliation data on the probe response presence and
not on the occupant model (which might be created from a message and
therefore not yet have up to date affiliation data).
2020-06-15 12:42:20 +02:00
JC Brand
80c955f267 Fix "retry" feature for message errors.
By registering a one-time event handler for a unique event name
2020-06-11 17:29:44 +02:00
Ariel Fuggini
48fcbfa5ea Finds names by RegExp with i param for case insensitive 2020-06-09 10:33:21 +02:00
JC Brand
c2c1db587f Create a component which renders message actions in a dropdown 2020-06-05 16:02:58 +02:00
JC Brand
6ad76c14ef Fix test failure on travis 2020-06-05 16:02:23 +02:00
JC Brand
18b0d8db3f Don't indent followup messages when messages don't have avatars 2020-06-04 15:29:06 +02:00
JC Brand
85e9169b35 Use the API to read settings 2020-06-03 10:15:05 +02:00
JC Brand
830e060568 Rename api.settings.update to api.settings.extend
This is to try and make it clearer that this method won't override
initialization settings, and is instead simply to add to the default
settings.
2020-06-03 09:32:16 +02:00
JC Brand
279a6e6cb8 Increase test timeouts 2020-06-03 09:15:35 +02:00
JC Brand
1ff6ced3ab Don't override initialization settings via api.settings.update
This is a problem that could occur when calling converse.initialize twice
2020-06-03 09:15:35 +02:00
JC Brand
5a57ded243 Add support for the XEP-0333 displayed chat marker
Credit for this work goes to @deleolajide
2020-06-01 18:01:02 +02:00
JC Brand
ac36adddfe Re-add support for a new messages indicator
Fixes #2040
2020-06-01 16:52:12 +02:00
JC Brand
deb7c63910 Add test for the /clear command 2020-06-01 15:42:37 +02:00
JC Brand
7651d58470 Render chat messages as web components
- Render chat content as a <converse-chat-content> component
- Create new component for rendering the message body
- Get rid of `showMessage` method
2020-06-01 09:53:19 +02:00
Dele Olajide
cae5e9c875 Updates #1999 - Demarcate first unread message 2020-05-13 13:39:33 +02:00
Ariel Fuggini
c70a256eb1 Added mailto protocol to safe list 2020-05-13 11:18:39 +02:00
JC Brand
efb486511c Add another test for registration errors and fix bug 2020-05-12 15:32:52 +02:00
Ariel Fuggini
5674056c3f Fixes, added tests 2020-05-07 18:28:19 +02:00
JC Brand
555c0966cc muc: save error response to a sent message onto the original model 2020-05-07 13:32:56 +02:00
JC Brand
e67230633f Add test for muc_send_probe setting 2020-05-07 10:54:03 +02:00
JC Brand
6cd2fac33c Set more test timeouts 2020-04-28 12:19:22 +02:00
JC Brand
0c5593ed75 Various smaller fixes
- Fix failing tests.
- Bump timeout for emoji tests
- Remove unused files.
- Update features section.
2020-04-28 10:42:20 +02:00
JC Brand
b5eea12d49 Refactor so that message attributes are parsed early
It's better to parse an incoming message stanza early, than to have
all kinds of methods throughout the codebase that does querySelector
etc.

Firstly, it allows us to catch and report errors and malicious stanzas early on.
It also simplifies programming because you don't need to try and
remember how to properly parse a stanza, all the work is done upfront
for you.
2020-04-27 16:34:37 +02:00
JC Brand
bad815b429 Bugfix. Don't create multiple RosterContactView objects 2020-04-27 16:30:33 +02:00
JC Brand
958379682a muc: Render role change messages as ephemeral notifications 2020-04-23 15:11:36 +02:00
JC Brand
4b270359f6 Use Karma as test runner 2020-04-23 11:55:51 +02:00
JC Brand
7e23adf26f Remove the need for require.js to run tests 2020-04-22 12:10:39 +02:00
JC Brand
c1efb0d2b4 Add an external API for sending presences 2020-04-19 09:41:38 +02:00
JC Brand
8a7b25584d Show error messages via objects
Instead of injecting them directly into the DOM.
2020-04-19 08:03:44 +02:00
JC Brand
60b3f7ae25 Add an autocomplete component 2020-04-17 11:01:44 +02:00
Dele Olajide
f97d827280
fix #1963 - Mentions are visually incorrect when used in message replies (#1968)
* fix #1963 - Mentions are visually incorrect when used in message replies
2020-04-15 12:25:53 +02:00
JC Brand
c9084e4ed5 muc-views: Present challenge to destroy confirmation
And also allow the user to specify the JID to where the conversation has
moved to.
2020-04-15 09:30:10 +02:00
JC Brand
df9612f937 Add support for XEP-0317 MUC Hats 2020-04-13 22:57:29 +02:00
JC Brand
a1d5563963 Move OMEMO-related message parsing to utils/stanza.js 2020-04-13 17:44:47 +02:00
JC Brand
e91a38547a MUC: create role/affiliation change message objects
in @converse/headless instead of injecting HTML via the view
2020-04-13 11:21:40 +02:00
JC Brand
4ef5363024 Fix failing tests 2020-04-10 16:59:34 +02:00
JC Brand
4425c3dde7 Always show a new topic, even if the previous one was hidden 2020-04-08 14:31:18 +02:00
JC Brand
bc4d016557 Don't show duplicate topic change notifications 2020-04-08 13:08:15 +02:00
JC Brand
5fd316816d MUC: Don't show topic change notification for old changes.
Also, show topic by creating a message object, instead of directly
inserting HTML into the DOM. This is a necessary precursor to being able
to render chat messages via lit-html/lit-element.
2020-04-07 11:49:12 +02:00
JC Brand
e18fe5e212 Use the getHeadingButtons hook instead of overrides 2020-04-07 10:20:43 +02:00
JC Brand
531ebf335c Properly test and fix show/hide of MUC topic 2020-04-06 15:27:32 +02:00
JC Brand
bb9e394e93 muc: handle join/leave notifications similarly to CSNs
Remove the `muc_show_join_leave_status` config setting.
We don't show the optional statuses at all now.
2020-04-01 14:34:11 +02:00
JC Brand
c20dbbbbbd Store in user settings whether a MUC topic is hidden or not 2020-03-31 22:57:22 +02:00
JC Brand
6391cc0803 Rename applyUserSettings to applySiteSettings 2020-03-31 14:08:34 +02:00
JC Brand
631b9bb438 Use the settings API for setting and getting config settings
This is an initial step towards no longer storing and accessing settings
directly via the `_converse` object
2020-03-31 11:57:03 +02:00
JC Brand
321a54323e Allow moderators to retract their own messages...
when retractions are restricted to mods only
2020-03-26 10:35:08 +01:00
JC Brand
6865a73f46 Fix failing tests 2020-03-25 12:18:19 +01:00
JC Brand
e3bd7b45f5 Distinguish between chat content and messages content.
Fixes a bug that prevented scrolling from working correctly
2020-03-24 14:34:57 +01:00
JC Brand
7812d4e7b6 Show chat state notifications inside the scrollable area
Rename CSS class to conform to convention
2020-03-24 11:28:50 +01:00
JC Brand
5e27579ebe Don't ignore groupchat messages that also contain a CSN 2020-03-23 20:54:27 +01:00