Fixes #486 Update docs and fix failing test.

This commit is contained in:
JC Brand 2017-02-12 19:01:07 +00:00
parent c34dcfaadc
commit 6d2a38a7c1
4 changed files with 11 additions and 6 deletions

View File

@ -7,6 +7,7 @@
- *Breaking change*: Callbacks for `converse.on` now no longer receive an event - *Breaking change*: Callbacks for `converse.on` now no longer receive an event
object as first parameter. [jcbrand] object as first parameter. [jcbrand]
- Use lodash instead of underscore.js [jcbrand] - Use lodash instead of underscore.js [jcbrand]
- #486 Honor existing mam user configuration [throwaway42]
## 2.0.5 (Unreleased) ## 2.0.5 (Unreleased)
- #743, #751, #753 Update to Strophe 1.2.12. SASL-EXTERNAL now has reduced priority, so it won't - #743, #751, #753 Update to Strophe 1.2.12. SASL-EXTERNAL now has reduced priority, so it won't

View File

@ -656,13 +656,17 @@ Similar to `default_domain`_ but no other domains are allowed.
message_archiving message_archiving
----------------- -----------------
* Default: ``never`` * Default: ``undefined``
Provides support for `XEP-0313: Message Archive Management <https://xmpp.org/extensions/xep-0313.html>`_, Provides support for `XEP-0313: Message Archive Management <https://xmpp.org/extensions/xep-0313.html>`_,
whereby messages are archived in the XMPP server for later retrieval. Note, your XMPP server must support whereby messages are archived in the XMPP server for later retrieval.
XEP-0313 MAM for this to work. Note, your XMPP server must support XEP-0313 MAM for this to work.
This option sets the default archiving preference. Valid values are ``never``, ``always`` and ``roster``. This option sets the default archiving preference.
Valid values are ``undefined``, ``never``, ``always`` and ``roster``.
``undefined`` means that any existing MAM configuration, as set by the user or
the server administrator, will be used.
``roster`` means that only messages to and from JIDs in your roster will be ``roster`` means that only messages to and from JIDs in your roster will be
archived. The other two values are self-explanatory. archived. The other two values are self-explanatory.

View File

@ -375,6 +375,7 @@
IQ_id = sendIQ.bind(this)(iq, callback, errback); IQ_id = sendIQ.bind(this)(iq, callback, errback);
}); });
spyOn(_converse, 'onMAMPreferences').andCallThrough(); spyOn(_converse, 'onMAMPreferences').andCallThrough();
_converse.message_archiving = 'never';
var feature = new _converse.Feature({ var feature = new _converse.Feature({
'var': Strophe.NS.MAM 'var': Strophe.NS.MAM
@ -389,7 +390,6 @@
"</iq>" "</iq>"
); );
_converse.message_archiving = 'never';
/* Example 15. Server responds with current preferences /* Example 15. Server responds with current preferences
* *
* <iq type='result' id='juliet2'> * <iq type='result' id='juliet2'>

View File

@ -287,7 +287,7 @@
var prefs = feature.get('preferences') || {}; var prefs = feature.get('preferences') || {};
if (feature.get('var') === Strophe.NS.MAM && if (feature.get('var') === Strophe.NS.MAM &&
prefs['default'] !== _converse.message_archiving && prefs['default'] !== _converse.message_archiving &&
_converse.message_archiving ) { !_.isUndefined(_converse.message_archiving) ) {
// Ask the server for archiving preferences // Ask the server for archiving preferences
_converse.connection.sendIQ( _converse.connection.sendIQ(
$iq({'type': 'get'}).c('prefs', {'xmlns': Strophe.NS.MAM}), $iq({'type': 'get'}).c('prefs', {'xmlns': Strophe.NS.MAM}),