Commit Graph

33 Commits

Author SHA1 Message Date
JC Brand
bf4b3efa5b Import _converse and api 2020-05-18 10:54:37 +02:00
JC Brand
7e2552bd8c core: Allow multiple imports 2020-04-23 13:50:35 +02:00
JC Brand
030c26a8ab Use api shortcut instead of _converse.api 2020-03-31 13:16:24 +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
690ff1fba1 Fixes #1860 2020-03-30 04:13:46 +02:00
JC Brand
967154d314 Use optional chaining instead of lodash.get 2020-03-24 12:30:45 +01:00
JC Brand
11e219dd41 Update copyright 2020-01-30 17:36:55 +01:00
JC Brand
a8104d7498 Add Skeletor as dependency 2020-01-30 17:36:55 +01:00
Christoph Scholz
36e56052bc don't log error if user has no bookmarks 2020-01-10 21:12:59 +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
caadb24310 Refactor logging out into its own module
So that we don't need to `_converse` obj in order to log messages
2019-11-22 13:50:36 +01:00
JC Brand
23797dee21 _converse.api.alert.show is now _converse.api.show
Instead of taking an integer for the `type`, "info", "warn" or "error" should be passed in.
2019-10-31 14:42:44 +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
be03b30d75 bookmarks: better handling of timeouts
- Inform the user when fetching of bookmarks times out.
- Only set the cached flag if the user doesn't have bookmarks.
2019-10-15 13:09:34 +02:00
JC Brand
c8b7e8ab99 bookmarks: refactor to use VDOMView instead of OrderedListView 2019-10-13 17:53:57 +02:00
JC Brand
82bce1e946 Move creation of browserStorage into a separate method
This is in anticipation of the localforage/IndexDB merge
2019-10-11 20:40:31 +02:00
JC Brand
b63b080419 chatboxes: wait until messages are fixed before returning new chatbox
Fixes #1691
2019-10-10 14:44:13 +02:00
JC Brand
463caf36a1 bookmarks: silently remove bookmarks when clearing the session 2019-09-26 16:43:26 +02:00
JC Brand
768ed4a577 Replace lodash methods with built-ins, convert docstrings to JSDoc 2019-09-07 23:14:33 +02:00
JC Brand
93de11d167 Dynamically load the dayjs translation.
Also, remove the Promise polyfill. We don't support browsers which don't support promises.
2019-08-23 14:03:52 +02:00
JC Brand
aa9aad918f Handle case where bookmark doesn't exist for some reason 2019-08-10 12:06:01 +02:00
JC Brand
c0ef008c4a converse-bookmarks: Call _converse.Collection.prototype.clearSession 2019-08-07 16:12:21 +02:00
JC Brand
7a590f7c22 Stop using certain lodash methods.
* _.isNil
* _.noop
* _.isNull
2019-08-05 10:56:22 +02:00
JC Brand
cd392bb197 Fixes #1561 Don't clear localStorage and sessionStorage 2019-08-01 11:34:14 +02:00
JC Brand
e20b654876 Stop using _.isUndefined 2019-07-29 10:32:29 +02:00
JC Brand
3a2bf766a0 Add new test utility waitUntilBookmarksReturned 2019-07-12 10:38:07 +02:00
JC Brand
8a98ef87fe Various small fixes. (Unused imports, unused vars etc). 2019-07-11 12:37:17 +02:00
JC Brand
d95a7987ce Fix linting errors and add @module jsdoc directives 2019-07-11 10:48:52 +02:00
JC Brand
da713f3162 Improve chatroom name rendering
- Take locked_muc_domain into consideration in chatroom display name
- Use getDisplayName when rendering the heading name
- Give preference to bookmark name if it exists
2019-05-29 13:27:41 +02:00
JC Brand
1ef29bee4e Use composition instead of overrides 2019-05-24 16:02:07 +02:00
JC Brand
b876500865 Update to latest backbone.overview 2019-05-23 14:44:10 +02:00
JC Brand
4c924a66df Split bookmarks plugin into headless and views
Fixes #1577
2019-05-21 11:35:00 +02:00
JC Brand
d1d81bf933 Bugfix. Remove condition before fetching members 2019-05-21 11:33:01 +02:00