Skip to content
Snippets Groups Projects

History loading

Merged Emmanuel Vodor requested to merge history_loading into beta
1 file
+ 9
1
Compare changes
  • Side-by-side
  • Inline
@@ -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;
Loading