When updating message schema pre-SQLCipher, use legacy save
This commit is contained in:
@@ -35,6 +35,7 @@ module.exports = {
|
||||
removeDB,
|
||||
|
||||
saveMessage,
|
||||
saveLegacyMessage,
|
||||
saveMessages,
|
||||
removeMessage,
|
||||
_removeMessages,
|
||||
@@ -205,6 +206,12 @@ async function saveMessage(data, { forceSave } = {}) {
|
||||
return id;
|
||||
}
|
||||
|
||||
async function saveLegacyMessage(data, { Message }) {
|
||||
const message = new Message(data);
|
||||
await deferredToPromise(message.save());
|
||||
return message.id;
|
||||
}
|
||||
|
||||
async function saveMessages(arrayOfMessages, { forceSave } = {}) {
|
||||
await channels.saveMessages(_cleanData(arrayOfMessages), { forceSave });
|
||||
}
|
||||
|
Reference in New Issue
Block a user