Skip to content

Commit

Permalink
runfix: welcome message not being sent in self conversation anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrykBuniX committed Jun 20, 2023
1 parent 16e7f7f commit 14156ea
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/script/conversation/ConversationRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2114,21 +2114,13 @@ export class ConversationRepository {
? {domain: '', id: eventData.conversationId}
: qualified_conversation || {domain: '', id: conversation};

if (type === CONVERSATION_EVENT.MLS_WELCOME_MESSAGE) {
useMLSConversationState.getState().markAsEstablished(eventData);
}

const inSelfConversation = this.conversationState.isSelfConversation(conversationId);
if (inSelfConversation) {
const typesInSelfConversation = [
CONVERSATION_EVENT.MEMBER_UPDATE,
ClientEvent.CONVERSATION.MESSAGE_HIDDEN,
/**
* As of today (07/07/2022) the backend sends `WELCOME` message to the user's own
* conversation (not the actual conversation that the welcome should be part of)
*/
CONVERSATION_EVENT.MLS_WELCOME_MESSAGE,
];

if (type === CONVERSATION_EVENT.MLS_WELCOME_MESSAGE) {
useMLSConversationState.getState().markAsEstablished(eventData);
}
const typesInSelfConversation = [CONVERSATION_EVENT.MEMBER_UPDATE, ClientEvent.CONVERSATION.MESSAGE_HIDDEN];

const isExpectedType = typesInSelfConversation.includes(type);
if (!isExpectedType) {
Expand Down

0 comments on commit 14156ea

Please sign in to comment.