Commit Graph

1251 Commits

Author SHA1 Message Date
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
JC Brand
57709b2e78 Sort modtools search results by nickname 2020-03-23 18:06:36 +01:00
JC Brand
00cac6d250 Add the ability to filter the results in the modtools modal 2020-03-23 14:34:19 +01:00
JC Brand
b215c59bd0 Add more XSS tests 2020-03-21 21:43:29 +01:00
JC Brand
540a85e8db Move XSS tests into a separate spec 2020-03-21 21:12:36 +01:00
JC Brand
b5d57f0ef8 Handle and render chat state notifications separately from messages 2020-03-21 17:21:53 +01:00
JC Brand
ca012d4479 Update to newer Skeletor.js
`.forEach` on a Collection no longer returns the models, so need to
update some tests.
2020-03-12 15:24:29 +01:00
JC Brand
c9f29f76e5 Use lit-html to render URLs 2020-03-06 12:24:23 +01:00
JC Brand
366dee0aa5 Bugfix. Allow moderators to retract their own messages 2020-03-05 13:42:58 +01:00
JC Brand
a7f28cd61d When creating message objects, wait for confirmation from storage
Queue messages and handle them sequentially, each time waiting for promises to
resolve before handling the next message.

Updates #1899, which likely happens because an error message is received
before messages have been fetched.
2020-03-04 15:14:57 +01:00
Lance Stout
a6aaf3f595 Update chat state notifications when message is edited. 2020-03-03 15:24:15 +01:00
JC Brand
f34cc63d4c Log out before running test
To avoid one test which times out, causing subsequent tests to not be
run (and therefore also time out).
2020-03-03 15:12:20 +01:00
JC Brand
831e59c1a7 controlbox: Wait when saving while closing
Otherwise we run into race conditions while testing
2020-03-03 14:38:29 +01:00
JC Brand
8aaa1a6417 core: Make clearSession a synchronous event
In order to give plugins time to properly clear data from the browser storage.
2020-03-03 10:23:46 +01:00
JC Brand
9295850789 controlbox Only call show/hide callback when the action was actually done 2020-03-03 08:21:55 +01:00
JC Brand
2af93f4492 modtools: settings for which roles/affiliations may be queried or assigned 2020-02-22 23:16:22 +01:00
JC Brand
e5341d54a9 Bugfix. Dangling moderation messages not applied 2020-02-22 22:59:30 +01:00
JC Brand
61e86a3c23 Fixes #1535
Add option to destroy MUC in the dropdown context menu.
Also add a confirmation dialog.
2020-02-22 20:22:02 +01:00
JC Brand
3c9ec96350 MUC: create references for nicks gathered from messages 2020-02-21 12:30:40 +01:00
JC Brand
d361d1d0a3 MUC: Include nicks from messages in the mentions auto-complete list 2020-02-20 19:14:34 +01:00
JC Brand
62ef18a027 muc_fetch_members now accepts an array of affiliations 2020-02-20 18:39:56 +01:00
JC Brand
49817a850f MUC: Queue messages received before we're ready 2020-02-20 07:13:04 +01:00
JC Brand
0137eb88ae Smacks: Handle MUC messages received before the MUC exists 2020-02-19 13:39:07 +01:00
JC Brand
ce08819a43 Retracted moderated sent message should not be editable. 2020-02-18 16:47:52 +01:00
JC Brand
ead8cdbcd6 Retracted moderated message should not be editable.
Also, don't set retracted MUC messages as ephemeral, we want to keep on
showing them to provide context in a MUC.
2020-02-18 16:06:59 +01:00
JC Brand
227b70339c Bugfix. Retracted messages shouldn't be editable. 2020-02-18 15:45:55 +01:00
JC Brand
004d2b7f23 Fix method name in log 2020-02-18 15:45:55 +01:00
JC Brand
f564a1edaf Show reason and actor for ban/kick events 2020-02-14 13:19:12 +01:00
JC Brand
39d140005e Change when/how chats are shown
Goal is to fix a timing bug that results in `show` being triggered
before the `ChatBoxView` has been initialized, which means that 1:1
chats aren't opened when you reload the page.
2020-02-14 11:06:04 +01:00
JC Brand
3400acbfeb Show MUC buttons in a dropdown menu
- Get rid of the ChatBoxHeading class
- Add support for showing standalone buttons in overlay viewmode
2020-02-13 20:57:47 +01:00
JC Brand
2235d4c432 Use lit-html to render MUC heading 2020-02-07 14:58:26 +01:00
JC Brand
7d91b17552 Rename methods to clarify their purpose 2020-02-07 12:42:19 +01:00
JC Brand
0653505a40 tests: Use u.getUniqueId instead of time for message ids 2020-02-07 12:35:54 +01:00
JC Brand
fb9fe280ac Updates to how dupes are detected.
- Collapse 3 different loops into one.
- Check all saved stanza ids in the parsed attrs, not just the archive id
- Remove check for archive id in converse-mam since it just duplicates what's now being done in converse-chat
- Don't use disco to check for support, XEP-359 mandates that services SHOULD advertise support,
  which is not a strong enough guarantee that they do.

updates #1856
2020-02-07 12:35:45 +01:00
JC Brand
6e8a987694 Fix failing test (when run in isolation) 2020-02-04 13:46:43 +01:00
JC Brand
7d7c41a135 OMEMO: fix timing errors
- Use async/await
- Wait for devices to be created before continuing
2020-02-03 23:24:44 +01:00
JC Brand
f78837cbc5 Refactor identification of duplicates...
to rely on the parsed stanza attributes

This was to fix a bug whereby a full stanza was used to query for 1:1
messages with a full JID when the bare JID is stored.

We now are sure that the attributes we're using to query for duplicates
are the same attributes that get saved for a messages.
2020-02-03 23:24:44 +01:00