Commit b44c0c26 authored by JC Brand's avatar JC Brand

mam: Add `MAMResult` hook

parent ad499938
......@@ -110,7 +110,7 @@
"newline-per-chained-call": "off",
"no-alert": "off",
"no-array-constructor": "error",
"no-await-in-loop": "error",
"no-await-in-loop": "off",
"no-bitwise": "off",
"no-caller": "error",
"no-console": "off",
......
......@@ -6,14 +6,14 @@
*/
import "converse-modal";
import "@converse/headless/utils/muc";
import { BootstrapModal } from "./converse-modal.js";
import { Model } from 'skeletor.js/src/model.js';
import { View } from 'skeletor.js/src/view.js';
import { __ } from '@converse/headless/i18n';
import { api, converse } from "@converse/headless/converse-core";
import { debounce, head, isString, isUndefined } from "lodash";
import { BootstrapModal } from "./converse-modal.js";
import { render } from "lit-html";
import { __ } from '@converse/headless/i18n';
import RoomDetailsModal from 'modals/muc-details.js';
import { converse } from "@converse/headless/converse-core";
import log from "@converse/headless/log";
import st from "@converse/headless/utils/stanza";
import tpl_add_chatroom_modal from "templates/add_chatroom_modal.js";
......@@ -89,7 +89,6 @@ converse.plugins.add('converse-muc-views', {
initialize () {
const { _converse } = this;
const { api } = _converse;
api.promises.add(['roomsPanelRendered']);
......
......@@ -98,7 +98,8 @@ converse.plugins.add('converse-mam', {
}, options);
const result = await api.archive.query(query);
/* eslint-disable no-await-in-loop */
api.hook('MAMResult', this, { result, query });
for (const message of result.messages) {
try {
await msg_handler(message);
......
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