Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(chat): Fixes sending messages after private message sender leaves.

damencho7bd0f479b903
diff --git a/react/features/chat/middleware.ts b/react/features/chat/middleware.ts
index f9b0084953..737fd87f65 100644
--- a/react/features/chat/middleware.ts
+++ b/react/features/chat/middleware.ts
@@ -255,7 +255,7 @@ MiddlewareRegistry.register(store => next => action => {
const conference = getCurrentConference(state);
if (conference) {
- // There may be cases when we intend to send a private message but we forget to set the
+ // There may be cases when we intend to send a private message, but we forgot to set the
// recipient. This logic tries to mitigate this risk.
const shouldSendPrivateMessageTo = _shouldSendPrivateMessageTo(state, action);
@@ -269,29 +269,32 @@ MiddlewareRegistry.register(store => next => action => {
isFromVisitor: shouldSendPrivateMessageTo.isFromVisitor,
displayName: shouldSendPrivateMessageTo.name
}));
+
+ // the dialog will take care of sending the message after user confirmation
+ break;
}
- } else {
- // Sending the message if privacy notice doesn't need to be shown.
+ }
- const { privateMessageRecipient, isLobbyChatActive, lobbyMessageRecipient }
- = state['features/chat'];
+ // Sending the message if privacy notice doesn't need to be shown.
- if (typeof APP !== 'undefined') {
- APP.API.notifySendingChatMessage(action.message, Boolean(privateMessageRecipient));
- }
+ const { privateMessageRecipient, isLobbyChatActive, lobbyMessageRecipient }
+ = state['features/chat'];
- if (isLobbyChatActive && lobbyMessageRecipient) {
- conference.sendLobbyMessage({
- type: LOBBY_CHAT_MESSAGE,
- message: action.message
- }, lobbyMessageRecipient.id);
- _persistSentPrivateMessage(store, lobbyMessageRecipient, action.message, true);
- } else if (privateMessageRecipient) {
- conference.sendPrivateTextMessage(privateMessageRecipient.id, action.message, 'body', isVisitorChatParticipant(privateMessageRecipient));
- _persistSentPrivateMessage(store, privateMessageRecipient, action.message);
- } else {
- conference.sendTextMessage(action.message);
- }
+ if (typeof APP !== 'undefined') {
+ APP.API.notifySendingChatMessage(action.message, Boolean(privateMessageRecipient));
+ }
+
+ if (isLobbyChatActive && lobbyMessageRecipient) {
+ conference.sendLobbyMessage({
+ type: LOBBY_CHAT_MESSAGE,
+ message: action.message
+ }, lobbyMessageRecipient.id);
+ _persistSentPrivateMessage(store, lobbyMessageRecipient, action.message, true);
+ } else if (privateMessageRecipient) {
+ conference.sendPrivateTextMessage(privateMessageRecipient.id, action.message, 'body', isVisitorChatParticipant(privateMessageRecipient));
+ _persistSentPrivateMessage(store, privateMessageRecipient, action.message);
+ } else {
+ conference.sendTextMessage(action.message);
}
}
break;