Apply new ESLint rules to legacy code

This commit is contained in:
Chris Svenningsen 2020-09-08 17:46:29 -07:00 committed by Scott Nonnenberg
parent 91cf075697
commit 8a2c17f65f
70 changed files with 376 additions and 516 deletions

View file

@ -111,20 +111,22 @@ const createRandomMessage = async ({ conversationId } = {}) => {
const _createMessage = ({ commonProperties, conversationId, type } = {}) => {
switch (type) {
case 'incoming':
return Object.assign({}, commonProperties, {
return {
...commonProperties,
flags: 0,
source: conversationId,
sourceDevice: 1,
});
};
case 'outgoing':
return Object.assign({}, commonProperties, {
return {
...commonProperties,
delivered: 1,
delivered_to: [conversationId],
expireTimer: 0,
recipients: [conversationId],
sent_to: [conversationId],
synced: true,
});
};
default:
throw new TypeError(`Unknown message type: '${type}'`);
}