Commit Graph

659 Commits

Author SHA1 Message Date
Dele Olajide
5a9f8218c8
Fix issue 1896 (#1897)
* fix issue https://github.com/conversejs/converse.js/issues/1896

* Added issue to CHANGES.md
2020-02-28 11:24:25 +01:00
JC Brand
f02caff854 Rejoin the MUC if we receive an empty message 2020-02-27 16:40:29 +01:00
JC Brand
34c4b2aa5e Prevent empty messages from being created 2020-02-27 15:09:54 +01:00
JC Brand
e5341d54a9 Bugfix. Dangling moderation messages not applied 2020-02-22 22:59:30 +01:00
JC Brand
5fe23f477f modtools: Fetch affiliation list when we haven't fetched it by default 2020-02-21 16:20:30 +01:00
JC Brand
3c9ec96350 MUC: create references for nicks gathered from messages 2020-02-21 12:30:40 +01:00
JC Brand
62ef18a027 muc_fetch_members now accepts an array of affiliations 2020-02-20 18:39:56 +01:00
JC Brand
590a8862bc Don't validate message creation
This causes messages to be created but then not populated, causing empty
messages appearing in the chat after page relaod.

Fixes #1886
2020-02-20 13:08:12 +01:00
JC Brand
49817a850f MUC: Queue messages received before we're ready 2020-02-20 07:13:04 +01:00
JC Brand
58f6d36564 MUC: wait for messages collection to be initialized
before processing MUC messages received prematurely due to SMACKS
resumption.
2020-02-19 14:22:24 +01:00
JC Brand
0137eb88ae Smacks: Handle MUC messages received before the MUC exists 2020-02-19 13:39:07 +01:00
JC Brand
5b5c4595cc Rename hide_subject to subject_hidden 2020-02-18 17:26:49 +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
bcbde04530 Copy sounds dir to dist and use assets_path for sounds_path 2020-02-16 12:30:25 +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
ed411c226d Avoid creating Message objects for empty messages 2020-02-13 16:31:13 +01:00
JC Brand
181d18fcfe Translation and undefined variable fixes 2020-02-11 10:13:23 +01:00
JC Brand
faa02b058d Make sure messages Collection exists when we receive an error message 2020-02-10 18:41:32 +01:00
JC Brand
7d91b17552 Rename methods to clarify their purpose 2020-02-07 12:42:19 +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
746fe441e2 Updates the message parsing.
Only set `id` once we've actually parsed the sender attributes,
otherwise `attrs.from` is `undefined`.

Use `Array.prototype.reduce` to generate stanza_ids attributes map.

Add `from_muc` attribute which contains the MUC JID
2020-02-07 12:12:38 +01:00
JC Brand
d2b6b41128 emoji-picker: Make sure that emojis as images are rendered properly 2020-02-06 16:27:44 +01:00
JC Brand
a1670462ca Remove jquery and undersscore shims 2020-02-06 14:51:50 +01:00
JC Brand
7279f08a34 Update to newer skeletor which can return a promise on create 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
JC Brand
73fa24a844 headlines: move view code into converse-headlines-view.js 2020-01-30 18:18:27 +01:00
JC Brand
29aed314c1 Remove Backbone
* Remove backbone as NPM deps and from docs
* Remove backbone stuff from webpack
2020-01-30 17:36:55 +01:00
JC Brand
9fb2056753 Move MUC invite widget into a modal 2020-01-30 17:36:55 +01:00
JC Brand
c6ac03e94e Fix linting errors 2020-01-30 17:36:55 +01:00
JC Brand
d32c4c1f61 muc-views: replace VDOMView with HTMLView 2020-01-30 17:36:55 +01:00
JC Brand
11e219dd41 Update copyright 2020-01-30 17:36:55 +01:00
JC Brand
ad93407907 Replace modal templates with lit-html components 2020-01-30 17:36:55 +01:00
JC Brand
a8104d7498 Add Skeletor as dependency 2020-01-30 17:36:55 +01:00
JC Brand
50e6c8a082 roster: refactor to use async/await 2020-01-30 17:36:55 +01:00
JC Brand
b08f5d355b roster: avoid race-condition by waiting for contacts to be fetched
before creating any new ones
2020-01-30 17:36:55 +01:00
laszlovl
cde6b093c0 Fix incrementMsgCounter cleaning up after itself 2020-01-27 17:53:36 +01:00
Christoph Scholz
a472a0806e show headline messages in controlbox 2020-01-23 11:32:15 +01:00
JC Brand
bda704901f emoji-views: lazily render picker only once user clicks to open 2020-01-22 15:00:16 +01:00
JC Brand
f3472e1b9f emoji: Add initialize API method and call when chat view gets created 2020-01-22 13:20:59 +01:00
JC Brand
685c9585f4 Fix linting error 2020-01-21 14:06:47 +01:00
JC Brand
b0a9782d31 emoji: Lazy load the emoji JSON
Only load it once the first chat has been opened.
2020-01-21 12:45:34 +01:00
JC Brand
161cbec0d8 For forbidden errors, show error message from server 2020-01-17 14:44:05 +01:00
JC Brand
aa86a8be32 muc: Store room configuration (e.g. disco#info fields) on the MUC
This will make it easier to add config-based functionality, such as
allowing/showing the `/topic` slash command only to those users who are
allowed to set the subject.
2020-01-16 15:28:02 +01:00
JC Brand
929a00e1cd Fixes #1836 2020-01-16 13:48:46 +01:00
JC Brand
9ce315dece Bugfix. Handle stanza that clears the MUC subject 2020-01-14 10:07:23 +01:00
Christoph Scholz
40726e06e9 A user can now add himself as a contact 2020-01-13 10:30:00 +01:00
JC Brand
496e5ba46d Fix linting error 2020-01-13 09:00:08 +01:00
JC Brand
2a3ca93256 core: don't use Chrome-only check for web auth support 2020-01-12 01:35:44 +01:00
JC Brand
22ff93c3a7 core: Import individual lodash methods
and use some native ones instead
2020-01-12 01:08:37 +01:00
Christoph Scholz
36e56052bc don't log error if user has no bookmarks 2020-01-10 21:12:59 +01:00
JC Brand
9c5fc2e4d3 Use package.json files to specify more precisely what gets packed 2020-01-10 13:29:42 +01:00
JC Brand
e866248227 Don't include vim temp-files in release tarball
and bump post-release version number
2020-01-10 13:04:05 +01:00
JC Brand
cd60614f88 Release 6.0.0 2020-01-09 17:15:43 +01:00
JC Brand
4f4b10d2a3 muc: initialize occupants early to avoid timing issues...
in converse-omemo which relies on `chatbox.occupants` existing in the
`add` handler.
2020-01-09 17:07:31 +01:00
JC Brand
4018dd959e Fixes #1764: Incorrect URI encoding in references 2020-01-09 14:59:45 +01:00
JC Brand
ef1f16c186 Fixes #1767: Remove JID so that credentials_url is called...
when the user logs out and then in again
2020-01-09 11:05:37 +01:00
JC Brand
995f2a9997 Add arrow navigation to the emoji picker 2020-01-07 15:47:05 +01:00
JC Brand
2b213d0561 log: properly log to the set level 2020-01-06 10:40:18 +01:00
Yaskhan
1653c1ae92 Update converse-mam.js
I think why do not come archives from group chats, and it turns out that you need to add "groupchat" in options. I spent half an hour searching in the documentation, and half an hour searching in the convers tests. And finally found in tests.
2019-12-26 15:56:04 +02:00
JC Brand
d8e561ef7e Fix linting errors 2019-12-20 16:02:53 +01:00
JC Brand
9b4276721c Remove unnecessary await statement 2019-12-19 13:12:12 +01:00
JC Brand
da319604b6 Fixes #1735: Chatboxes stay empty after logging out and in again
The problem was that the `emojisInitialized` promise was re-created upon
logout and then no longer resolved upon subsequent login.

The `_converse.api.promises.add` method now takes another parameter
`replace` which determine whether it should be replaced upon logout or
not.

The `emojisInitialized` promise will now not get replaced.
2019-12-18 16:09:44 +01:00
JC Brand
8b6c902c4c Set VCards via events, thereby reducing coupling
- Rename `chatRoomOpened` event to `chatRoomViewInitialized`
- Rename `chatBoxInitialized` to `chatBoxViewInitialized` and trigger only for `ChatBoxView` instances.
- New event `headlinesBoxViewInitialized`
- Trigger the `chatBoxInitialized` event when a new `_converse.ChatBox` is opened.
2019-12-18 15:20:51 +01:00
JC Brand
b0e66232d3 Fixes #1253: Show contacts with unread messages at the top of the roster 2019-12-18 11:42:26 +01:00
JC Brand
03b7ae0a30 Improvements to how things are stored.
- Use the bare JID as indexedDB dataStore
- Collapse localStorage and indexedDB stores into one `persistent` store.
- When testing, only clear test data
2019-12-17 13:59:43 +01:00
JC Brand
4aa6b728cf muc: wait for restoreSession 2019-12-11 16:20:08 +01:00
JC Brand
0f63c84d5b core: properly clear cache in clearSession
Bump to latest backbone.browserStorage which adds the `clear` method
2019-12-11 15:44:56 +01:00
JC Brand
c379807d4c muc: Move code into restoreSession method 2019-12-11 10:06:26 +01:00
JC Brand
f3a1351a42 muc: loosen isJoined criteria
Handle any `error` IQ result or timeout from a MUC ping as indication that we're no longer joined.
2019-12-11 10:06:03 +01:00
JC Brand
a4567ee075 muc: Store connection_status in session storage
Otherwise we might run into a situation where a very old,
cached MUC that's being restored has `connection_status` set to ENTERED
(and the user happens to be in the MUC via another client)
and then restores cached messages without taking
`clear_messages_on_reconnection` into account.
2019-12-11 08:10:27 +01:00
JC Brand
09b085be6e muc: no need to override tearDown
we already listen for `beforeTearDown` and do what's necessary there.
2019-12-11 08:10:25 +01:00
JC Brand
3d3738f3be muc: refactor MUC joining
We now distinguish more clearly between joining and re-joining a MUC.

The `enterRoom` method has been refactored away.

Instead, `join` or `rejoin` should be used, depending on the circumstances.

Don't fetch cached occupants in the `initialize` function, instead, only fetch
them if we're restoring a MUC that we're still connected to.

If we're not restoring a still-connected MUC, then we clear the
occupants cache, and the messages cache if `clear_messages_on_reconnection` is `true`.

updates #1807
updates #1808
2019-12-09 17:17:33 +01:00
JC Brand
7bf39a092f muc: move message handler into own method 2019-12-06 13:09:09 +01:00
Dele Olajide
890db3427f Handle message notifications about affiliation change for users not in a room
See https://git.happy-dev.fr/startinblox/components/sib-chat/issues/96
2019-12-06 12:55:07 +01:00
JC Brand
c646879cca Ping the server when the tab becomes visible 2019-12-06 10:57:52 +01:00
JC Brand
5b507ec74e muc: check that we're still connected if the tab becomes visible
Otherwise Converse might only realise we're no longer in the room when
the user tries to interact with it.
2019-12-05 22:29:37 +01:00
JC Brand
7866247f5d dragresize: Unregister global event handlers 2019-12-05 21:02:06 +01:00
JC Brand
b1c9af3ed0 Various improvements to resizing of occupants view.
- Remove need for the `converse-mouse-events` plugin.
- Register `mousemove` and `mouseup` handlers only when necessary and only inside the MUC DOM element.
- Restore converse-dragresize to roughly it's original state before work started on this.
- Move `applyDragResistance` to utils.

updates #1640
2019-12-05 09:32:48 +01:00
JC Brand
0c4da63e07 Merge branch 'pullRequest_SkalierungTeilnehmerListe' of github.com:worlword/converse.js 2019-12-04 14:55:47 +01:00
JC Brand
dffe3d1a26 smacks: Set enable_smacks to true as default 2019-12-03 13:54:28 +01:00
JC Brand
c3447dd205 New config option: `persistent_store`
Allows for using IndexedDB as the persistent store, instead of localStorage
2019-12-03 13:51:57 +01:00
JC Brand
5232019ed7 roster: Replace lodash methods with native ones 2019-12-03 12:37:26 +01:00
JC Brand
7fc3151e56 Fixes #1783 2019-12-03 11:31:28 +01:00
JC Brand
d2cf29bce4 muc: One more place to fetch messages
When restoring an already entered room from cache.
Otherwise we end up with an empty history.
2019-11-29 17:04:54 +01:00
JC Brand
1c116b0385 mam: distinguish between messages fetched before and after MUC join 2019-11-29 16:17:48 +01:00
JC Brand
53ced8c763 muc: Don't restore messages from cache...
if we're just going to clear them again

This avoids flashing of messages followed by a spinner.
2019-11-29 09:58:38 +01:00
JC Brand
d7d810ba89 Improvements to rendering MUC MAM logs before joining
- Add config variable `muc_show_logs_before_join`
- Restore nickname form for the original use-case (when not showing MAM logs before joining).
- Render nickname form in the `.muc-bottom-panel` when showing MAM logs (instead of in a modal)
- Show a message when there aren't any archived messages to show
- Fix converse-mam so that chat logs are properly fetched before entering a MUC

closes #1266
2019-11-29 09:23:15 +01:00
JC Brand
c836eb401f disco: Import individual lodash methods 2019-11-26 22:04:50 +01:00
JC Brand
762717dd38 Bugfix. streamFeaturesAdded triggered too soon.
`streamFeaturesAdded` should only be triggered once we've received them
from the server.

This appears to be a timing bug, likely introduced by the IndexedDB
refactoring.
2019-11-26 22:04:50 +01:00
JC Brand
e23c7ce543 More retraction updates
- Retracted moderated message are not editable
- Use "removed" for user-facing text
2019-11-26 22:04:38 +01:00
JC Brand
13ffe5a667 Various smaller retraction related fixes and improvements 2019-11-26 12:16:48 +01:00
JC Brand
53df5d6b49 Fix whitelisting and dependencies on the headline plugins 2019-11-22 14:38:09 +01:00
JC Brand
3ffb56baa2 Replace debug configuration setting with loglevel 2019-11-22 14:23:19 +01:00
JC Brand
2e3cc12d9a Bugfix. Only remove modals when disconnected
not while tearing down, otherwise the modals get removed while
reconnecting and we have stale references to modals no longer in the
DOM.
2019-11-22 13:50:36 +01:00
JC Brand
025cdbf18f Check for support before allowing message moderation 2019-11-22 13:50:36 +01:00