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