Merge branch 'various-closed-group-fixes' of https://github.com/Bilb/loki-messenger into closed-group-fixes

pull/1220/head
Vincent 5 years ago
commit 5a2b91d572

@ -632,9 +632,11 @@ export async function handleMessageEvent(event: any): Promise<void> {
conversationId = primarySource.key; conversationId = primarySource.key;
} }
// the conversation with the primary device of that source (can be the same as conversationOrigin) // be sure to call this one with conversationId. because we might need to create the primary conversation from a message of a secondary device
const conversation = window.ConversationController.get(conversationId); const conversation = await window.ConversationController.getOrCreateAndWait(
conversationId,
type
);
conversation.queueJob(() => { conversation.queueJob(() => {
handleMessageJob( handleMessageJob(
msg, msg,

@ -105,6 +105,8 @@ export class SessionProtocol {
public static async sendSessionRequestIfNeeded( public static async sendSessionRequestIfNeeded(
pubkey: PubKey pubkey: PubKey
): Promise<void> { ): Promise<void> {
const { ConversationController } = window;
if ( if (
(await SessionProtocol.hasSession(pubkey)) || (await SessionProtocol.hasSession(pubkey)) ||
(await SessionProtocol.hasSentSessionRequest(pubkey)) (await SessionProtocol.hasSentSessionRequest(pubkey))

@ -110,7 +110,6 @@ describe('state/selectors/conversations', () => {
assert.strictEqual(conversations[1].name, 'Á'); assert.strictEqual(conversations[1].name, 'Á');
assert.strictEqual(conversations[2].name, 'B'); assert.strictEqual(conversations[2].name, 'B');
assert.strictEqual(conversations[3].name, 'C'); assert.strictEqual(conversations[3].name, 'C');
assert.strictEqual(conversations[4].name, 'No timestamp');
}); });
}); });
}); });

Loading…
Cancel
Save