diff --git a/src/headless/plugins/mam/index.js b/src/headless/plugins/mam/index.js index 6293f2a04..da1c0ecee 100644 --- a/src/headless/plugins/mam/index.js +++ b/src/headless/plugins/mam/index.js @@ -48,19 +48,13 @@ converse.plugins.add('converse-mam', { api.listen.on('enteredNewRoom', muc => muc.features.get('mam_enabled') && fetchNewestMessages(muc)); api.listen.on('chatReconnected', chat => { - // XXX: For MUCs, we listen to enteredNewRoom instead if (chat.get('type') === _converse.PRIVATE_CHAT_TYPE) { fetchNewestMessages(chat); } }); api.listen.on('afterMessagesFetched', chat => { - // XXX: We don't want to query MAM every time this is triggered - // since it's not necessary when the chat is restored from cache. - // (given that BOSH or SMACKS will ensure that you get messages - // sent during the reload). - // With MUCs we can listen for `enteredNewRoom`. - if (chat.get('type') === _converse.PRIVATE_CHAT_TYPE && !_converse.connection.restored) { + if (chat.get('type') === _converse.PRIVATE_CHAT_TYPE) { fetchNewestMessages(chat); } });