Commit Graph

51 Commits

Author SHA1 Message Date
JC Brand
9a2ded5a9a Remove global lodash 2020-12-29 15:12:45 +01:00
Christoph Scholz
07f2f285ff Fix issue #2168 2020-10-02 12:07:48 +02:00
JC Brand
0ca2e5ae08 Remove need for lodash templates in headless build 2020-09-26 09:58:34 +02:00
JC Brand
a014eca9e7 Add a renderImage directive which handles errors 2020-07-09 20:51:32 +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
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
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
6865a73f46 Fix failing tests 2020-03-25 12:18:19 +01:00
JC Brand
c9f29f76e5 Use lit-html to render URLs 2020-03-06 12:24:23 +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
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
1fa203c990 Support for IndexedDB. updates #1105
Depend on latest backbone.browserStorage which has support for IndexedDB
via localforage.

Storage operations are now asynchronous and transactional.

Bugs fixed (mostly by waiting for operations to complete):

* Rooms are now fetched asynchronously, so wait before triggering `show`
  or when closing.
* Make sure chat create/update transactions complete before firing events
* Make sure chats and messages have been fetched before creating new ones.
* When doing a `fetch` with `wait: false` on a collection and then
  creating a model in that collection, then once the read
  operation finishes (after creating the model), the collection is emptied again.
* Patch and wait when saving.
  Otherwise we have previously set attributes overriding later ones.
* Make sure api.roomviews.close returns a promise

Test fixes:

* Chats are now asynchronously returned, so we need to use `await`
* Wait for the storage transaction to complete when creating and updating messages
* Wait for all chatboxes to close
    Otherwise we get sessionStorage inconsistencies due to the async nature of localforage.
* Wait for room views to close in spec/chatroom.js

In the process, remove the `closeAllChatBoxes` override in
converse-controlbox by letting the `close` method decide whether it
should be closed or not.
2019-10-30 13:02:23 +01:00
JC Brand
877e07775a Remove need to pass in spies to initConverse
They aren't used anymore.
2019-10-11 17:46:13 +02:00
JC Brand
8780f7a128 Fix linting errors (no-unused-vars) 2019-10-09 16:27:58 +02:00
JC Brand
3cc993740e Fix failing tests 2019-08-23 21:36:53 +02:00
JC Brand
4cb9fd88a8 Refactor emojis so that JSON is fetch asynchronously 2019-08-22 13:56:47 +02:00
JC Brand
89ac4a6969 Show error message with option to retry when MAM query times out 2019-08-13 11:08:03 +02:00
JC Brand
3b29e5754d Don't unnecessarily fetch the roster
If we've fetched the roster before within this session, then we don't
have to do so again, regardless of whether versioning is supported or
not, otherwise, even if we have a cached roster, we still need to get
the latest one again.
2019-08-02 10:46:30 +02:00
JC Brand
a1630b5c1f Replace wait-until-promise with utility method
and bump default timeout

Also let `_converse.api.waitUntil` use it if a function is passed in.
2019-07-11 23:34:27 +02:00
JC Brand
1a3526f537 Update openAndEnterChatRoom to take JID 2019-07-04 08:28:12 +02:00
JC Brand
737e27c726 Use shakespearean character names in tests 2019-06-03 09:43:24 +02:00
JC Brand
a95bb5b26a Refactor tests so that IQ_ids always contains only XML stanzas 2019-05-20 14:37:29 +02:00
JC Brand
39363d495f Fetch messages in MUC model 2019-05-20 09:25:11 +02:00
JC Brand
2526d80464 Change api.disco.supports to resolve to a Boolean
Also add a new API method `api.disco.features.get` for the use-case
where you still want the feature object to be returned.
2019-05-07 10:27:25 +02:00
JC Brand
f897703565 Rename emit to trigger for consistency with Backbone.Events 2019-03-29 21:56:56 +01:00
JC Brand
9f5031c278 Make converse.initialize an async function
- Combine all test init functions into `initConverse`
- Use `async` functions in more tests
- Replace `var` with `let` and `const` in more tests
- New utils method `toStanza` which converts a string to a Node
2019-02-12 15:34:50 +01:00
JC Brand
abe21dce66 Include origin-id in outgoing messages 2019-02-08 15:34:16 -07:00
Christoph Scholz
267d91a4f3 don't send receipt requests in MUCs 2018-11-20 17:38:59 +01:00
JC Brand
86593dc378 Don't render http (i.e. non-TLS) resources
Causes "Mixed Content" TLS errors
2018-11-18 18:05:47 +01:00
Christoph Scholz
da5ca0b585 implement XEP-0184: Message Delivery Receipts 2018-11-13 17:13:35 +01:00
JC Brand
53b3f2d0d6 Fix failing tests and rewrite to use async/await 2018-10-26 12:53:24 +02:00
JC Brand
e181aaf99b Make the message view's render method async
So that we first render dynamic content (e.g. images) before inserting
it into the chat.

Also, add the `show_images_inline` setting (which is the cause of this
whole change).

Updated tests to handle this new change and start using async/await
instead of promise callbacks.
2018-10-15 22:19:04 +02:00
JC Brand
9bc8bdf34c Test updates after updating to use latest strophe.js
`toLocaleString` now returns element attributes in alphabetical order
(for better cross-browser consistency).

Also, `toLocaleString` is now used in favor of `outerHTML` because
browsers aren't consistent with one another in their output.
2018-10-03 21:11:20 +02:00
JC Brand
506aa33131 Wait for promises before opening chats in API methods 2018-08-01 11:12:00 +02:00
JC Brand
4115461409 Make tests independent of URL at which they're run 2018-07-31 19:13:49 +02:00
JC Brand
acd9a18696 Update with new message markup 2018-07-21 07:34:03 +02:00
JC Brand
bc872ee2cb Fix various failing tests and update Makefile 2018-06-04 11:20:34 +02:00
JC Brand
596082eecc Get tests to run agains the webpack build 2018-06-03 16:40:20 +02:00
JC Brand
5ffb09bd15 Updates #161: Treat sent files also as oob messages 2018-04-30 15:37:37 +02:00
JC Brand
a15c9e54d0 Also test for when XEP-0363 is not supported
Updates #161
2018-04-22 17:47:34 +02:00
JC Brand
d73394fa37 Add tests for XEP-0363 for MUC
Update #161
2018-04-22 17:30:49 +02:00
JC Brand
f785c2df0a Fix linting errors 2018-04-18 17:29:51 +02:00
JC Brand
d048cff9a8 Provide metadata of file being uploaded.
updates #161
2018-04-18 11:49:53 +02:00
JC Brand
133df99aec Honor the filesize restrictions of the XMPP server
updates #161
2018-04-18 11:35:33 +02:00
JC Brand
076ace3fad Parse and save jabberdata formdata from a disco#info result 2018-04-17 16:42:20 +02:00
JC Brand
c01e9f8265 Move methods from chatbox view to message view
Specifically the methods related to requesting an upload slot and uploading a file.
Also show a progress indicator while a file is being uploaded.

Updates #161
2018-04-17 15:21:38 +02:00
JC Brand
584f293d05 Updated and refactored the work from @worlword
* Use Promises instead of callbacks
* Update to latest (Last Call) version of XEP-0363
* Move non-view specific methods to models instead
* Add more tests

updates #161
2018-04-17 15:21:09 +02:00
JC Brand
042c1947ed Add file-upload button 2018-04-14 07:40:07 +02:00
JC Brand
a9d2881888 Fix disco hierarchy
Previously we kept all entities and their items (which are also
instances of _converse.DiscoEntity) in a flat array.

Instead, we should have a tree-like structure where items are stored
on the relevant entity (and recursively on other items).
2018-04-14 07:36:24 +02:00