Commit Graph

3580 Commits

Author SHA1 Message Date
JC Brand
906fa93812 MUC: combine two methods doing roughly the same thing 2021-02-12 14:32:55 +01:00
JC Brand
9ce4092a7c Turn the bottom panel into a custom element 2021-02-12 14:32:55 +01:00
JC Brand
94bc087f50 Move MUC templates to the plugin folder 2021-02-11 20:25:20 +01:00
JC Brand
8b052e20b9 Fix tests by pinning to latest @converse/skeletor 2021-02-10 16:14:34 +01:00
JC Brand
45e0ba7f9b Use this.listenTo instead of api.listen.on in components
So that event handlers are automatically deregistered when the component is dismounted.
2021-02-10 11:44:04 +01:00
JC Brand
a32b7b64bf Fix display of lgoged-out controlbox in fullpage mode 2021-02-10 11:37:48 +01:00
JC Brand
78fb5935c7 Handle scrolling down in converse-chat-content component 2021-02-09 18:20:52 +01:00
JC Brand
95c14e5a26 Don't pass chatview object to converse-chat-content
and any child components.

This makes it easier to use these components independently of one
another and the overarching view.
2021-02-09 16:40:00 +01:00
JC Brand
f81292e955 Bugfix in window state change handler 2021-02-09 15:48:21 +01:00
JC Brand
790caf9f5a Render converse-chat-content declaratively 2021-02-09 15:48:21 +01:00
JC Brand
18e48be5c4 Move CSS fixes before merge 2021-02-09 15:48:21 +01:00
JC Brand
3f24720633 Use repeat directive to render roster items 2021-02-09 15:48:21 +01:00
JC Brand
28fb2472a4 Chats: use repeat directive 2021-02-09 15:48:21 +01:00
JC Brand
22b6b4b502 minchats: Use utility methods instead of mixins
Various fixes to chat minimization
2021-02-09 15:48:21 +01:00
JC Brand
7abc81f8a4 MUC: Wait until occupants are fetched before updating them 2021-02-09 15:48:21 +01:00
JC Brand
ea6e370347 MUC: Fix error message logging 2021-02-09 15:48:21 +01:00
JC Brand
9f5dbad589 Turn roster into a custom element 2021-02-09 15:48:21 +01:00
JC Brand
7407a5a681 Fix auto-insert into converse-root 2021-02-09 15:48:21 +01:00
JC Brand
b8d710800a Move more methods from ChatBoxView to shared base class 2021-02-09 15:48:21 +01:00
JC Brand
bb317d1abb Combine RoomsPanel with RoomsList element 2021-02-09 15:48:21 +01:00
JC Brand
b31f334109 Fix event handlers in BookmarksView 2021-02-09 15:48:21 +01:00
JC Brand
05c00c5e1c Call minimize on the model
Fix minimizing by listening to change event

Fixes around showing/hiding and minimizing/maximizing

Don't trigger a `show` event on the model to show a chat, instead rely
on the `hidden` attribute which causes a rerender and will show/hide
chats.
2021-02-09 15:48:21 +01:00
JC Brand
704b50fb3e Turn HeadlinesBox into a custom element 2021-02-09 15:48:21 +01:00
JC Brand
fa7443be95 Don't render unnecessary components when not in overlayed view mode
Specifically `converse-minimized-chats` and `converse-controlbox-toggle`
2021-02-09 15:48:21 +01:00
JC Brand
d1c807ec79 Fixes to the bookmarks-list view 2021-02-09 15:48:21 +01:00
JC Brand
d6c0129c86 Various CSS fixes 2021-02-09 15:48:21 +01:00
JC Brand
fd2f253c09 Add .chatroom class to converse-muc and remove .logged-out to controlbox 2021-02-09 15:48:21 +01:00
JC Brand
a029ece808 Controlbox related bugfixes 2021-02-09 15:48:21 +01:00
JC Brand
e64798208f Remove overrides of renderLoginPanel
which has also been removed earlier
2021-02-09 15:48:21 +01:00
JC Brand
be9016a081 Fix switching between login and register panels 2021-02-09 15:48:21 +01:00
JC Brand
75b8a16465 Fix CSS and work on declaratively rendering the controlbox toggle 2021-02-09 15:48:21 +01:00
JC Brand
a59920e6e5 Turn XMPPStatusView into the converse-user-profile component 2021-02-09 15:48:21 +01:00
JC Brand
6ca2183e24 Remove unneeded ControlBoxPane view 2021-02-09 15:48:21 +01:00
JC Brand
bb7d1c5cba Turn login and register panels into element views 2021-02-09 15:48:21 +01:00
JC Brand
0ecd86ecf7 Turn MinimizedChatsView into an ElementView subclass 2021-02-09 15:48:21 +01:00
JC Brand
ccfb29f1b3 Turn BookmarksView into a custom element 2021-02-09 15:48:21 +01:00
JC Brand
b9bf577ccd Turn rooms list into a custom element 2021-02-09 15:48:21 +01:00
JC Brand
7f869ea72d Make the headlines panel an ElementView
Don't manually insert HeadlinesBoxView
we'll have to convert it to an ElementView
2021-02-09 15:48:21 +01:00
JC Brand
dea2eea919 Componentize dragresize 2021-02-09 15:48:21 +01:00
JC Brand
1949356ede Work on turning chat views into custom elements
The eventual goal is to avoid UI-related stanza processing if the relevant chats
aren't in the DOM.

With the current architecture, chatboxes are created (and the stanzas
related to them processed) even if `#conversejs` isn't in the DOM.

* Initial work on making controlbox an element
* Create a shared base class
* Ceate ChatBoxViews proxy
* Update sass now that certain classes are moved to converse-chats element
2021-02-09 15:48:21 +01:00
JC Brand
eb65f75f45 Move headlines panel template to plugin 2021-02-09 15:48:21 +01:00
Ariel Fuggini
758c46c5aa Fixes infinite loop bug when appending .png to allowed image urls 2021-02-09 15:38:06 +01:00
JC Brand
581f892613 Add JSDoc string 2021-02-06 11:26:25 +01:00
JC Brand
0a1cbf87b8 MUC: Ensure that MAM query is from latest cached messages
In some cases a race condition can occur where a new message is received
before the MAM query starts.

Previously, the newly received message would be considered the latest
message to query from, thereby causing a gap in the history.
2021-02-03 10:27:46 +01:00
JC Brand
5feaab9a95 MUC: Add test for showing cached messages before entering 2021-02-02 15:12:31 +01:00
JC Brand
9568d57e5f Pass message attrs to shouldNotifyOfGroupMessage 2021-02-01 17:50:46 +01:00
JC Brand
5d1b5ac6c9 Notifiations: Add new hook shouldNotifyOfGroupMessage 2021-02-01 17:14:35 +01:00
JC Brand
50dda3244e Move converse-notifications plugin into a folder and split up 2021-02-01 16:15:55 +01:00
JC Brand
7f851208aa Move converse-roster plugin into folder and split up 2021-01-26 14:34:36 +01:00
JC Brand
7199e63fd7 Move converse-profile plugin into folder 2021-01-22 15:49:16 +01:00
JC Brand
85bd192f3c Move converse-minimize into a folder
Also, use utility methods instead of adding a mixin to ChatBoxViews
(since we're planning on removing it).
2021-01-18 12:56:17 +01:00
JC Brand
1a88aff179 Decided to still collapse newlines...
and to solve the offset issue by replacing excessive newlines with
the zero-width space unicode character.
2021-01-18 12:18:33 +01:00
JC Brand
61bb0cfab7 Don't collapse newlines.
This causes index offset issues with any rich elements in the message.

We could try to fix the offsets, or alternatively replace the collapsed
newlines with spaces (to maintain the original offsets), but I don't
think it's worth the effort since I'm not sure that it's a good idea to
collapse newlines in the first place.
2021-01-18 11:27:01 +01:00
JC Brand
2c7b220453 RAI: Always send the presence to enable RAI when leaving a MUC
Looking at the Prosody code, it appears to be cheap since
Prosody will do nothing if you're already registered and this works
around a bug in mod_muc_rai where events aren't fired for each resource
of the same joined nick joining or leaving the MUC.
2021-01-15 13:55:40 +01:00
JC Brand
8bd2114d8a MUC has its own method for sending markers 2021-01-15 11:39:09 +01:00
JC Brand
c0249b9c28 New configuration setting send_chat_markers
Can be used to fine-tune which (if any) of the XEP-0333 chat markers
will be sent out.
2021-01-15 11:11:38 +01:00
JC Brand
26c1c483da MAM fix: Get newest page when not paging
This is done by using `before: ''` and filtering by `start`.
Otherwise we get the oldest page.
2021-01-13 13:33:28 +01:00
JC Brand
dcd1407109 New config setting mam_request_all_pages 2021-01-13 10:42:22 +01:00
JC Brand
b5b35a97c6 Bugfix. Ad-hoc form fields didn't render.
Also... clear info message before executing ad-hoc command so that user
gets visiual indication.
2021-01-11 15:06:51 +01:00
JC Brand
58c5e9676a Handle forwarded mentions coming from the MUC, not the host 2021-01-08 18:25:36 +01:00
JC Brand
5e6a6ba6ac Fix failing bookmark tests 2021-01-08 14:36:48 +01:00
JC Brand
9a2678450a Move converse-bookmarks plugin into folder 2021-01-08 14:28:36 +01:00
JC Brand
bb8c7423b6 Ignore XEP-0437 indicators and forwarded mentions in a joined MUC
Otherwise the mentions will be counted twice.
2021-01-08 10:38:03 +01:00
JC Brand
2f5cc3b271 Bugfix. Make sure arguments are passed to all triggered events 2021-01-08 09:39:35 +01:00
JC Brand
11023dfef9 Don't clear occupants when leaving a MUC, only when closing it
Otherwise, when leaving as part of RAI and in a MUC where we only get
presence info based on probes, we lose occupant info that doesn't get
recreated when we rejoin.
2021-01-07 15:08:29 +01:00
JC Brand
2da2dbff71 Move converse-bookmark-views into folder 2021-01-07 13:29:55 +01:00
JC Brand
eaa67dab91 Bugfix. Filtering of contacts stopped working after refactoring 2021-01-07 12:52:56 +01:00
JC Brand
680701667e Bugfix: Image modal didn't have src attr on render 2021-01-06 15:07:19 +01:00
JC Brand
3f47c4d3dd Use real JID in XEP-0372 references only when the MUC is non-anonymous 2021-01-04 14:24:23 +01:00
JC Brand
9a2ded5a9a Remove global lodash 2020-12-29 15:12:45 +01:00
JC Brand
c1847a0b34 Use lit-html to render room description in modal 2020-12-29 12:49:09 +01:00
JC Brand
5e0b05356f dragresize: use lit-html to render the template 2020-12-29 12:40:16 +01:00
JC Brand
12bb9375f4 Move converse-dragresize plugin to folder 2020-12-29 12:38:17 +01:00
JC Brand
f2ef8c7206 controlbox: render the toggle via lit-html 2020-12-29 12:23:39 +01:00
JC Brand
3f40098144 Render logo for registration form
Also fix showing of version number in login form
2020-12-29 12:16:23 +01:00
JC Brand
9372ad2dff register: Use lit-html to render templates 2020-12-29 11:49:25 +01:00
JC Brand
e31fa1f7dd Move converse-register plugin to folder 2020-12-29 10:36:59 +01:00
JC Brand
828eac1e72 rosterview: Move more lodash templates to lit-html 2020-12-28 21:20:18 +01:00
JC Brand
bb3ac36098 Render the roster container and filter with lit-html
This is the first commit that makes use of the `ElementView` from
Skeletor, which lets us turn views into custom elements.
2020-12-28 20:56:37 +01:00
JC Brand
794a709690 Move converse-rosterview plugin into folder 2020-12-28 19:46:40 +01:00
JC Brand
da131715ba Use lit-html to render form fields 2020-12-28 18:25:51 +01:00
JC Brand
62dbb1062f Add support for protoXEP: MUC mention notifications 2020-12-21 14:02:43 +01:00
JC Brand
6b9c718df7 RAI: Handle MUCs that start out hidden
When a MUC starts out hidden, we first need to join in order to find out
whether we're affiliated before we can know whether we should enable RAI
or join the MUC as usual.
2020-12-21 12:07:00 +01:00
JC Brand
986f7550f3 Clear messages upon reconnection as late as possible
To avoid a long empty flash while new messages are being fetched again.
2020-12-17 16:23:47 +01:00
JC Brand
1f476b8793 Move converse-mam plugin into own folder 2020-12-17 14:48:50 +01:00
JC Brand
8db1f3e3f3 MAM: refactor to functions instead of extending chats with methods 2020-12-17 14:10:28 +01:00
JC Brand
4349b016eb MUC: Only clear messages when MUC is left intentionally
by the user, and not as part of cleanup during logout or when leaving
automatically in order to receive XEP-0437 activity indicators.
2020-12-17 14:00:18 +01:00
JC Brand
18e6ebe9af MUC: Bugfix, don't set state to entered on unavailable presence 2020-12-17 13:04:24 +01:00
JC Brand
594332181b Call 'clearMessages' 2020-12-17 13:04:24 +01:00
JC Brand
2121766623 More RAI improvements
- Add test for incoming RAI message
- Only enable RAI if the user is affilated in MUC being left
- Handle error presence indicating a resouce-constraint
- Don't unregister stanza handlers in `leave`, since we still want to
  listen to RAI-related stanzas. Instead unregister upon the `destroy`
  event.
2020-12-17 13:04:24 +01:00
JC Brand
fe365a6561 Move converse-roomslist plugin into folder 2020-12-16 14:05:34 +01:00
JC Brand
eed9ee8033 RAI: Add tests 2020-12-16 13:48:14 +01:00
JC Brand
e80afbfe39 Move MUC and stanza utils into shared and plugin-specific files 2020-12-14 16:30:13 +01:00
JC Brand
e8eea6324e MUC: Send XEP-0333 markers with the MUC stanza id
See: https://xmpp.org/extensions/xep-0333.html#rules-muc
2020-12-14 16:30:13 +01:00
JC Brand
c457081597 WIP: Add support for XEP-437: Room Activity Indicators
- Send marker for last message before leaving and before subscribing to RAI
- clear cache of RAI-subscribed domains on reconnection
2020-12-14 13:11:24 +01:00
JC Brand
e6e416306e Properly handle child nodes for api.presence.send 2020-12-14 13:11:24 +01:00
JC Brand
14c9b2f4ae Clear message cache when closing a MUC 2020-12-11 13:57:16 +01:00
JC Brand
5a82478381 Declare sizzle as a dependency for @converse/headless 2020-12-10 17:13:40 +01:00
JC Brand
c855d2f4ce Updates #2350 Avoid bundling Strophe twice
by not importing Strophe outside of @converse/headless
2020-12-10 16:32:01 +01:00
JC Brand
4ece50d07c Add ability to pass child nodes to api.user.presence.send 2020-12-10 14:39:24 +01:00
JC Brand
23a4a20dc2 Bugfixes
Mesage versions modal didn't open on subsequent clicks
Autocomplete: avoid undefined error
2020-12-10 14:12:20 +01:00
JC Brand
bb3f52d2f2 Move the autocomplete code into ./shared
And remove it as a plugin.
2020-12-10 11:17:57 +01:00
JC Brand
9174be8ff3 Styling: Use only "local" offset for mentions 2020-12-09 18:09:38 +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
240fab99f4 Split chatboxviews/index.js into multiple files 2020-12-08 10:16:34 +01:00
JC Brand
e31d5ba939 Move converse-headlines-view plugin into a folder 2020-12-08 09:50:17 +01:00
JC Brand
c0fafcec70 Move converse-muc into a folder 2020-12-08 09:50:17 +01:00
JC Brand
e8536ebc88 Move converse-muc-views plugin into own folder 2020-12-08 09:50:17 +01:00
JC Brand
2b6c56f148 Move converse-chatview plugin into folder 2020-12-08 09:50:17 +01:00
JC Brand
ecfaba0781 Move converse-chatboxviews plugin into folder 2020-12-08 09:50:17 +01:00
JC Brand
4c1813d6d4 Move converse-controlbox plugin into folder 2020-12-08 09:50:17 +01:00
JC Brand
e3ebde9741 Move converse-chat plugin into folder 2020-12-07 16:30:11 +01:00
JC Brand
01e03fc677 Bump to Strophe 1.4.1 2020-12-04 14:06:04 +01:00
JC Brand
d47c72711b Document the button hooks 2020-12-03 16:56:54 +01:00
JC Brand
824bf2ed30 Move all plugin files to ./plugin folders
Rename converse-core.js to core.js
2020-12-03 16:41:15 +01:00
JC Brand
5dc7a442f6 New hook getMesageActionButtons
Allows 3rd party plugins to add more buttons to the message actions dropdown
2020-12-03 16:08:54 +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
34cba68432 Allow user modals to be opened from message headings 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
21dfd8a325 Bugfix: Set protocol after discovering connection methods
Otherwise if an endpoint was passed in with `converse.initialize`, then
that endpoint's protocol is (wrongly) used.
2020-11-30 18:21:33 +01:00
JC Brand
f5707c51c0 Update lt translations based on #1844 2020-11-30 14:49:30 +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
33f62bb93c Update changelog for previous revert and add title for img emoji 2020-11-26 14:25:54 +01:00
JC Brand
a65da05094 Revert "fix emoji-picker for use_system_emojis==false"
This reverts commit e0088a45da.
2020-11-26 14:19:30 +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
d2074afe9a Document breaking changes to message transformation events 2020-11-25 14:53:27 +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
357b6406e2 Postrelease 2020-11-23 10:29:42 +01:00
JC Brand
db1905fdb6 Release 7.0.2 2020-11-23 10:18:35 +01:00
nautilusx
c0e0a209e4 Translated using Weblate (German)
Currently translated at 100.0% (505 of 505 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/de/
2020-11-23 10:10:15 +01:00
Allan Nordhøy
77b737ad87 Translated using Weblate (Norwegian Bokmål)
Currently translated at 71.4% (361 of 505 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/nb_NO/
2020-11-23 10:10:15 +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
Yaron Shahrabani
2918a175ee Translated using Weblate (Hebrew)
Currently translated at 75.6% (382 of 505 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/he/
2020-11-19 12:44:45 +01:00
Oğuz Ersen
b03ea65943 Translated using Weblate (Turkish)
Currently translated at 100.0% (505 of 505 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/tr/
2020-11-19 11:41:42 +01:00
Xosé M
f2e1b5983e Translated using Weblate (Galician)
Currently translated at 100.0% (505 of 505 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/gl/
2020-11-19 11:41:13 +01:00
JC Brand
4520a04be9 Postrelease 2020-11-19 11:37:56 +01:00
JC Brand
85375842a8 Release 7.0.1 2020-11-19 11:23:04 +01:00
J. Lavoie
93d03106b6 Translated using Weblate (Portuguese (Brazil))
Currently translated at 99.8% (501 of 502 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/pt_BR/

Translated using Weblate (Spanish)

Currently translated at 90.6% (455 of 502 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/es/

Translated using Weblate (Finnish)

Currently translated at 86.0% (432 of 502 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/fi/

Translated using Weblate (Italian)

Currently translated at 100.0% (502 of 502 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/it/

Translated using Weblate (Polish)

Currently translated at 80.8% (406 of 502 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/pl/

Translated using Weblate (French)

Currently translated at 100.0% (502 of 502 strings)

Translation: Converse.js/Translations
Translate-URL: https://hosted.weblate.org/projects/conversejs/translations/fr/
2020-11-18 18:47:44 +01:00
JC Brand
3638056dd7 Added translation using Weblate (Swedish) 2020-11-18 18:47:44 +01:00