Clean up old messages, better handle errors from sending
This commit is contained in:
parent
bf63c7cc13
commit
727925a266
10 changed files with 232 additions and 66 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue