Enable ESLint `function-paren-newline` `multiline`

Per discussion.
This commit is contained in:
Daniel Gasienica 2018-02-15 17:12:18 -05:00
parent b660b6bc8e
commit 799c881763
3 changed files with 29 additions and 29 deletions

View File

@ -21,7 +21,7 @@ module.exports = {
}], }],
// putting params on their own line helps stay within line length limit // putting params on their own line helps stay within line length limit
'function-paren-newline': ['error', 'consistent'], 'function-paren-newline': ['error', 'multiline'],
// 90 characters allows three+ side-by-side screens on a standard-size monitor // 90 characters allows three+ side-by-side screens on a standard-size monitor
'max-len': ['error', { 'max-len': ['error', {

View File

@ -497,18 +497,19 @@
/* eslint-enable */ /* eslint-enable */
/* jshint ignore:start */ /* jshint ignore:start */
function createMessageHandler( function createMessageHandler({
{ createMessage, getMessageDescriptor, handleProfileUpdate } createMessage,
) { getMessageDescriptor,
handleProfileUpdate,
}) {
return async (event) => { return async (event) => {
const { data, confirm } = event; const { data, confirm } = event;
const messageDescriptor = getMessageDescriptor(data); const messageDescriptor = getMessageDescriptor(data);
const isProfileUpdate = Boolean( const { PROFILE_KEY_UPDATE } = textsecure.protobuf.DataMessage.Flags;
// eslint-disable-next-line no-bitwise // eslint-disable-next-line no-bitwise
data.message.flags & textsecure.protobuf.DataMessage.Flags.PROFILE_KEY_UPDATE const isProfileUpdate = Boolean(data.message.flags & PROFILE_KEY_UPDATE);
);
if (isProfileUpdate) { if (isProfileUpdate) {
return handleProfileUpdate({ data, confirm, messageDescriptor }); return handleProfileUpdate({ data, confirm, messageDescriptor });
} }
@ -522,7 +523,8 @@
const upgradedMessage = await Message.upgradeSchema(data.message); const upgradedMessage = await Message.upgradeSchema(data.message);
await ConversationController.getOrCreateAndWait( await ConversationController.getOrCreateAndWait(
messageDescriptor.id, messageDescriptor.type messageDescriptor.id,
messageDescriptor.type
); );
return message.handleDataMessage( return message.handleDataMessage(
upgradedMessage, upgradedMessage,
@ -533,9 +535,11 @@
} }
// Received: // Received:
async function handleMessageReceivedProfileUpdate( async function handleMessageReceivedProfileUpdate({
{ data, confirm, messageDescriptor } data,
) { confirm,
messageDescriptor,
}) {
const profileKey = data.message.profileKey.toArrayBuffer(); const profileKey = data.message.profileKey.toArrayBuffer();
const sender = await ConversationController.getOrCreateAndWait( const sender = await ConversationController.getOrCreateAndWait(
messageDescriptor.id, messageDescriptor.id,
@ -552,11 +556,10 @@
}); });
// Sent: // Sent:
async function handleMessageSentProfileUpdate( async function handleMessageSentProfileUpdate({ confirm, messageDescriptor }) {
{ confirm, messageDescriptor }
) {
const conversation = await ConversationController.getOrCreateAndWait( const conversation = await ConversationController.getOrCreateAndWait(
messageDescriptor.id, messageDescriptor.type messageDescriptor.id,
messageDescriptor.type
); );
await conversation.save({ profileSharing: true }); await conversation.save({ profileSharing: true });
return confirm(); return confirm();

View File

@ -617,9 +617,8 @@
now now
); );
const upgradedAttachments = await Promise.all( const upgradedAttachments =
attachments.map(Attachment.upgradeSchema) await Promise.all(attachments.map(Attachment.upgradeSchema));
);
const message = this.messageCollection.add({ const message = this.messageCollection.add({
body, body,
conversationId: this.id, conversationId: this.id,
@ -658,16 +657,14 @@
profileKey = storage.get('profileKey'); profileKey = storage.get('profileKey');
} }
message.send( message.send(sendFunc(
sendFunc( this.get('id'),
this.get('id'), body,
body, upgradedAttachments,
upgradedAttachments, now,
now, this.get('expireTimer'),
this.get('expireTimer'), profileKey
profileKey ));
)
);
}); });
}, },
/* jshint ignore:end */ /* jshint ignore:end */