Clean up old messages, better handle errors from sending
This commit is contained in:
@@ -49,6 +49,7 @@ module.exports = {
|
||||
getAllMessageIds,
|
||||
getMessagesBySentAt,
|
||||
getExpiredMessages,
|
||||
getOutgoingWithoutExpiresAt,
|
||||
getNextExpiringMessage,
|
||||
getMessagesByConversation,
|
||||
|
||||
@@ -319,11 +320,15 @@ async function getMessagesBySentAt(sentAt, { MessageCollection }) {
|
||||
}
|
||||
|
||||
async function getExpiredMessages({ MessageCollection }) {
|
||||
window.log.info('Load expired messages');
|
||||
const messages = await channels.getExpiredMessages();
|
||||
return new MessageCollection(messages);
|
||||
}
|
||||
|
||||
async function getOutgoingWithoutExpiresAt({ MessageCollection }) {
|
||||
const messages = await channels.getOutgoingWithoutExpiresAt();
|
||||
return new MessageCollection(messages);
|
||||
}
|
||||
|
||||
async function getNextExpiringMessage({ MessageCollection }) {
|
||||
const messages = await channels.getNextExpiringMessage();
|
||||
return new MessageCollection(messages);
|
||||
|
Reference in New Issue
Block a user