I can't get conversation last modified for old bubles
Hello,
For old bubbles I can't get the conversation last modified date,
For old bubles I get undefined for 'conversation.lastModification'
Regards,
Faissal
the code is as follow:
module.exports.removeOldBubbles = function removeOldBubbles (connexions) {
let bubbles = connexions.connRainbow.bubbles.getAll();
var bubblesCount = bubbles.length;
logger.info('Bubbles count = ' + bubblesCount);
var conversationBubblePromises = [];
var bubblesWithLastModificationDate = [];
if (bubblesCount > 0 /* constant.BUBBLES_NB_THRESHOLD */) {
for (let bubble of bubbles) {
conversationBubblePromises.push(
connexions.connRainbow.conversations.getBubbleConversation(bubble.jid).then((conversation) => {
bubblesWithLastModificationDate.push({
'bubble': conversation.bubble,
'lastModificationDate': new Date(conversation.lastModification),
'lastModification': conversation.lastModification
});
})
);
}
Promise.all(conversationBubblePromises)
.then(() => {
bubblesWithLastModificationDate.sort(function (a, b) {
return b.lastModificationDate - a.lastModificationDate;
});
for (let bubble of bubblesWithLastModificationDate) {
logger.info('Removing the bubble ' + bubble.bubble.jid + '\t last Modification date = ' + bubble.lastModificationDate + '\t last modification :' + bubble.lastModification);
}
});
}
};
-
Hello,
Could you post this request on the hub community:
https://support.openrainbow.com/hc/de/community/topics/115000150070-Hub-Support-Community
Thanks.
Regards,
Claire
Please sign in to leave a comment.
Comments
1 comment