Commit Graph

82 Commits

Author SHA1 Message Date
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
b6b085189b Attempt to restore BOSH session or auto_login before...
triggering connectionInitialized.

That way, when listening for `connectionInitialized`, we'll know when it
fires whether we've attached to a BOSH connection or not.
2019-07-26 16:43:35 +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
38a232fd45 Move BOSH code into a plugin
- Remove the `keepalive` configuration setting. It is now always implicitly `true`.
- Remove the `expose_rid_and_sid` configuration setting.
- A `prebind_url` is now mandatory when setting `authentication` to `prebind`.
- It's no longer possible to pass in `rid` and `sid` values to `converse.initialize.
2019-06-05 11:35:48 +02:00
JC Brand
737e27c726 Use shakespearean character names in tests 2019-06-03 09:43:24 +02:00
JC Brand
7b11d85503 Add support for XEP-0198 Stream Management
- New plugin `converse-smacks`
- New config option `enable_smacks`
- Rename session cache id from `converse.bosh-session` to `converse.session`
- Refactor logout and login as consistently used api methods
- Refactor session cache to store per JID

Fixes #316
2019-06-03 09:43:12 +02:00
JC Brand
a0f1a5cfaf Fetch chat messages in the model, not the view 2019-05-17 14:45:37 +02:00
JC Brand
6193a9dc80 Replace lodash methods with native ones and remove lodash.fp 2019-05-14 12:41:47 +02:00
JC Brand
d91a5ca6de Remove alias for xss. Upgrade pluggable.js to version 2.0.1 2019-05-13 18:54:00 +02:00
JC Brand
ad8d4c90b3 Fix failing test 2019-04-22 21:07:05 +02:00
JC Brand
725a382e3b Refactor initialization and defaults for chat boxes
- Let box_id start with char for valid HTML.
- No need to use SHA1 for box id
- No need for the user_id attribute.
- Set nickname when we set the roster contact.

Also...

- _converse.api.contacts.get is now async
- _converse.api.chats.create is now async
2019-04-18 16:14:51 +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
c22fe41aef Use async/await in tests 2018-11-22 14:25:56 +01:00
JC Brand
d341c6a13b Revert "Use getter to lazily create Strophe.Connection"
This reverts commit 7af73c3471.

Doesn't look like the right approach for adding support for XEP-0156.
Work on that will continue in a branch in the meantime.
2018-11-20 17:31:53 +01:00
JC Brand
7af73c3471 Use getter to lazily create Strophe.Connection 2018-11-18 18:05:47 +01:00
JC Brand
d3a684a57d Move some functions outside of the initialize closure 2018-11-15 23:10:40 +01: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
4c3645c559 Merge branch 'master' into converse-omemo 2018-08-03 14:47:20 +02:00
JC Brand
1443fdd447 (WIP) Wait for promises before opening chats in API methods 2018-08-01 11:10:43 +02:00
JC Brand
6785eff4a7 Merge branch 'master' into converse-omemo 2018-07-01 11:44:04 +02:00
JC Brand
596082eecc Get tests to run agains the webpack build 2018-06-03 16:40:20 +02:00
JC Brand
6042c233bc Add test that the OMEMO toolbar button renders
Fix and improve accordingly. updates #497
2018-05-23 12:51:01 +02:00
JC Brand
2f46bb8ce7 Fix failing tests 2018-03-14 23:10:31 +00:00
JC Brand
ca141401a0 Fix failing tests 2018-03-13 13:42:00 +01:00
JC Brand
4652385bb4 Remove jQuery from non-tests config 2018-01-04 12:11:03 +00:00
JC Brand
671691353a Use Backbone.NativeView instead of Backbone.View 2018-01-03 20:41:03 +00:00
JC Brand
7850c38faa disco: Create new plugin converse-disco.
We can now support feature discovery for multiple entities (although we
currently still only query for the user's own XMPP server).
2017-07-21 15:09:50 +02:00
JC Brand
16d62bf9e4 Fix broken tests due to using ES2015 promises 2017-07-11 17:05:02 +02:00
JC Brand
f81a94baf1 Move updateSettings to the private API.
Also add an API method for exposing new promises.

Update the plugin and API documentation, specifically concerning the above
changes.
2017-07-05 11:03:13 +02:00
JC Brand
02e5921415 Fix problem of stuck/hanging tests on TravisCI 2017-06-19 15:05:22 +02:00
JC Brand
6c262f7213 Various small changes to reduce (non-critical) errors during testing 2017-06-14 20:14:45 +02:00
JC Brand
0c61a5d791 core: Refactor common code into restoreBOSHSession 2017-05-11 10:42:10 +02:00
JC Brand
0c43e4b87c Upgrade to Jasmine 2.5.3 2017-04-06 11:31:05 +02:00
JC Brand
cfb0cd0970 New defaults 2017-02-27 10:41:46 +00:00
JC Brand
f60b4fc268 auto_away shouldn't change the user's status if it's set to dnd
Fixes #620
2017-02-25 09:52:31 +00:00
JC Brand
51fc401a24 Fix failing tests due to new defaults. 2017-02-17 09:45:34 +00:00
JC Brand
bc8e3e1a01 Return a Backbone.View object instead of a wrapper
When returning chat boxes via the API.

We can do this now because these API methods are only available to
(whitelisted) plugins.
2017-02-14 15:10:46 +00:00
JC Brand
fe6a9ca748 Merge converse-api and converse-core
Otherwise `require('converse-core')` can be called, exposing the inner converse
object.
2017-02-14 14:35:52 +00:00
JC Brand
a30cf931b8 Split API into public and private (plugin only) parts. 2017-02-02 20:09:52 +00:00
JC Brand
83feebb229 Two plugins changes
- Remove the `plugins.remove` API method.
- Throw an error when attempting to register multiple plugins with the same name.
2017-02-02 18:54:15 +00:00
JC Brand
b7b9711296 Rename the closured converse object to _converse
to indicate that it's private and to differentiate it from the outer "global"
converse object.
2017-02-02 18:34:13 +00:00
JC Brand
4dcb855562 Split API into public and private (plugin only) parts. 2017-02-02 18:30:59 +00:00
JC Brand
081f075aa9 Add eslint with lodash checking and apply its suggestions 2017-02-01 14:02:18 +01:00
Richard Icke
343e5777d1 first attempt to replace underscore with lodash 2017-02-01 14:00:38 +01:00
JC Brand
de07b6a529 No need for two AMD-load cycles. 2016-11-30 12:18:58 +00:00
JC Brand
9bf00241de Updates #721 Restore sessions when logging in anonymously
together with keepalive.
2016-11-07 18:48:49 +01:00
JC Brand
a2f4acdcee All tests suites now updated and isolated. 2016-11-03 13:59:05 +00:00
JC Brand
50275cce64 Remove shared state between tests
Only a small subset of tests currently working with this.
2016-11-03 13:59:05 +00:00
JC Brand
6ac4f2601d Fixes #677 Chatbox does not open after close
Problem was a race condition between hide and show methods.
Solution was to not hide the chat box during the initialize method.
2016-08-12 20:38:39 +00:00