Skip to content
Snippets Groups Projects
Commit bc4a95b4 authored by ubermanu's avatar ubermanu
Browse files

bugfix: fix the oldest message reference

parent dcce55a8
No related branches found
No related tags found
2 merge requests!113History, Reply to messages and RAI,!111History loading
...@@ -71,7 +71,7 @@ converse.plugins.add('sib-history-improved', { ...@@ -71,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