mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
Lint
This commit is contained in:
parent
255c7ada68
commit
b31b6bb912
|
@ -1,6 +1,6 @@
|
|||
/* global Whisper, Signal, setTimeout, clearTimeout, MessageController, NewReceiver */
|
||||
|
||||
const { isFunction, isNumber, omit } = require('lodash');
|
||||
const { isNumber, omit } = require('lodash');
|
||||
const getGuid = require('uuid/v4');
|
||||
const {
|
||||
getMessageById,
|
||||
|
|
|
@ -301,9 +301,7 @@ async function handleDecryptedEnvelope(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
export async function handleUnencryptedMessage({message : outerMessage} : any) {
|
||||
|
||||
export async function handleUnencryptedMessage({ message: outerMessage }: any) {
|
||||
const { source } = outerMessage;
|
||||
const { group, profile, profileKey } = outerMessage.message;
|
||||
|
||||
|
@ -315,27 +313,20 @@ export async function handleUnencryptedMessage({message : outerMessage} : any) {
|
|||
source,
|
||||
'private'
|
||||
);
|
||||
await updateProfile(
|
||||
conversation,
|
||||
profile,
|
||||
profileKey
|
||||
);
|
||||
await updateProfile(conversation, profile, profileKey);
|
||||
}
|
||||
|
||||
const primaryDevice = window.storage.get('primaryDevicePubKey');
|
||||
const isOurDevice = source &&
|
||||
(source === ourNumber || source === primaryDevice);
|
||||
const isOurDevice =
|
||||
source && (source === ourNumber || source === primaryDevice);
|
||||
const isPublicChatMessage =
|
||||
group &&
|
||||
group.id &&
|
||||
!!group.id.match(/^publicChat:/);
|
||||
group && group.id && !!group.id.match(/^publicChat:/);
|
||||
|
||||
const ev = {
|
||||
// Public chat messages from ourselves should be outgoing
|
||||
type: (isPublicChatMessage && isOurDevice) ? 'sent' : 'message',
|
||||
type: isPublicChatMessage && isOurDevice ? 'sent' : 'message',
|
||||
data: outerMessage,
|
||||
};
|
||||
|
||||
await handleMessageEvent(ev);
|
||||
|
||||
}
|
||||
|
|
|
@ -164,7 +164,6 @@ export class SwarmPolling {
|
|||
node: Snode,
|
||||
pubkey: PubKey
|
||||
): Promise<Array<any>> {
|
||||
|
||||
const edkey = node.pubkey_ed25519;
|
||||
|
||||
const pkStr = pubkey.key ? pubkey.key : pubkey;
|
||||
|
|
|
@ -21,22 +21,18 @@ describe('Sync Message Utils', () => {
|
|||
|
||||
// Fill half with secondaries, half with primaries
|
||||
const numConversations = 20;
|
||||
const primaryConversations = new Array(numConversations / 2)
|
||||
.fill({})
|
||||
.map(
|
||||
() =>
|
||||
new TestUtils.MockConversation({
|
||||
type: TestUtils.MockConversationType.Primary,
|
||||
})
|
||||
);
|
||||
const secondaryConversations = new Array(numConversations / 2)
|
||||
.fill({})
|
||||
.map(
|
||||
() =>
|
||||
new TestUtils.MockConversation({
|
||||
type: TestUtils.MockConversationType.Secondary,
|
||||
})
|
||||
);
|
||||
const primaryConversations = new Array(numConversations / 2).fill({}).map(
|
||||
() =>
|
||||
new TestUtils.MockConversation({
|
||||
type: TestUtils.MockConversationType.Primary,
|
||||
})
|
||||
);
|
||||
const secondaryConversations = new Array(numConversations / 2).fill({}).map(
|
||||
() =>
|
||||
new TestUtils.MockConversation({
|
||||
type: TestUtils.MockConversationType.Secondary,
|
||||
})
|
||||
);
|
||||
const conversations = [...primaryConversations, ...secondaryConversations];
|
||||
|
||||
const sandbox = sinon.createSandbox();
|
||||
|
|
Loading…
Reference in a new issue