Skip to content
Snippets Groups Projects
Commit c81dee09 authored by Emmanuel Vodor's avatar Emmanuel Vodor
Browse files

Merge branch 'history_loading' into 'beta'

History loading

See merge request !111
parents ad56b4d2 bc4a95b4
No related branches found
Tags v4.3.0-beta.3
2 merge requests!113History, Reply to messages and RAI,!111History loading
Pipeline #10478 passed
...@@ -34,6 +34,14 @@ converse.plugins.add('sib-history-improved', { ...@@ -34,6 +34,14 @@ converse.plugins.add('sib-history-improved', {
} }
}, },
}, },
ChatBox: {
/**
* Disable this event handler.
* Causes the history to be fetched twice for private chats.
*/
afterMessagesFetched() {
},
},
}, },
initialize() { initialize() {
const _converse = this._converse; const _converse = this._converse;
...@@ -63,7 +71,7 @@ converse.plugins.add('sib-history-improved', { ...@@ -63,7 +71,7 @@ converse.plugins.add('sib-history-improved', {
log.debug(`Chatbox needs more messages, count: ${counter}`); log.debug(`Chatbox needs more messages, count: ${counter}`);
const is_groupchat = data.chatbox.get('type') === converse.CHATROOMS_TYPE; const is_groupchat = data.chatbox.get('type') === converse.CHATROOMS_TYPE;
const oldest_message = messages.pop(); const oldest_message = messages[0] || null;
if (oldest_message) { if (oldest_message) {
const by_jid = is_groupchat ? data.chatbox.get('jid') : _converse.bare_jid; const by_jid = is_groupchat ? data.chatbox.get('jid') : _converse.bare_jid;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment