Commit 1653c1ae authored by Yaskhan's avatar Yaskhan Committed by JC Brand

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.
parent d8e561ef
...@@ -93,6 +93,7 @@ converse.plugins.add('converse-mam', { ...@@ -93,6 +93,7 @@ converse.plugins.add('converse-mam', {
* after which messages should be returned. Implies forward paging. * after which messages should be returned. Implies forward paging.
* @param { string } [options.with] - The JID of the entity with * @param { string } [options.with] - The JID of the entity with
* which messages were exchanged. * which messages were exchanged.
* @param { boolean } [options.groupchat] - True if archive in groupchat.
* @param { boolean } [page] - Whether this function should recursively * @param { boolean } [page] - Whether this function should recursively
* page through the entire result set if a limited number of results * page through the entire result set if a limited number of results
* were returned. * were returned.
...@@ -300,6 +301,7 @@ converse.plugins.add('converse-mam', { ...@@ -300,6 +301,7 @@ converse.plugins.add('converse-mam', {
* * `before` * * `before`
* * `index` * * `index`
* * `count` * * `count`
* * `groupchat`
* @throws {Error} An error is thrown if the XMPP server responds with an error. * @throws {Error} An error is thrown if the XMPP server responds with an error.
* @returns { (Promise<Object> | _converse.TimeoutError) } A promise which resolves * @returns { (Promise<Object> | _converse.TimeoutError) } A promise which resolves
* to an object which will have keys `messages` and `rsm` which contains a _converse.RSM * to an object which will have keys `messages` and `rsm` which contains a _converse.RSM
...@@ -343,7 +345,7 @@ converse.plugins.add('converse-mam', { ...@@ -343,7 +345,7 @@ converse.plugins.add('converse-mam', {
* // For a particular room * // For a particular room
* let result; * let result;
* try { * try {
* result = await _converse.api.archive.query({'with': 'discuss@conference.doglovers.net'}); * result = await _converse.api.archive.query({'with': 'discuss@conference.doglovers.net', 'groupchat': true});
* } catch (e) { * } catch (e) {
* // The query was not successful * // The query was not successful
* } * }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment