Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"js-md5": "0.6.1",
"js-sha512": "0.8.0",
"jwt-decode": "2.2.0",
"lib-jitsi-meet": "https://github.com/internxt/lib-jitsi-meet/releases/download/v.0.0.13/lib-jitsi-meet-0.0.13.tgz",
"lib-jitsi-meet": "https://github.com/internxt/lib-jitsi-meet/releases/download/v.0.0.15/lib-jitsi-meet-0.0.15.tgz",
"lodash-es": "4.17.21",
"moment": "2.29.4",
"moment-duration-format": "2.2.2",
Expand Down
2 changes: 2 additions & 0 deletions react/features/base/conference/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ export function getConferenceOptions(stateful: IStateful) {
delete config.analytics?.amplitudeAPPKey;
}

options.isChatEncrypted = true; // Encrypted by default

return options;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ interface ConferenceControlsProps extends WithTranslation {
_screensharing: boolean;
_screenShareActive: boolean;
_chatOpen: boolean;
_chatKeysArrived: boolean;
}

const ConferenceControls = ({
Expand All @@ -40,6 +41,7 @@ const ConferenceControls = ({
_screensharing,
_screenShareActive,
_chatOpen,
_chatKeysArrived
}: ConferenceControlsProps) => {
const [isOpenInviteUser, setIsOpenInviteUser] = useState(false);

Expand All @@ -59,7 +61,13 @@ const ConferenceControls = ({
};

const handleToggleChat = () => {
dispatch(toggleChat());
if(_chatKeysArrived) {
console.log("Toggling chat.");
dispatch(toggleChat());
}
else {
console.log("Chat keys have not arrived yet.");
}
};

return (
Expand Down Expand Up @@ -120,6 +128,7 @@ function mapStateToProps(state: IReduxState) {
_screensharing: isScreenVideoShared(state),
_screenShareActive: screenShareParticipants.length > 0,
_chatOpen: state["features/chat"].isOpen,
_chatKeysArrived: state["features/chat"].isKeysArrived,
};
}

Expand Down
9 changes: 9 additions & 0 deletions react/features/chat/actionTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,12 @@ export const SET_CHAT_IS_RESIZING = 'SET_CHAT_IS_RESIZING';
* }
*/
export const NOTIFY_PRIVATE_RECIPIENTS_CHANGED = 'NOTIFY_PRIVATE_RECIPIENTS_CHANGED';

/**
* The type of action makes the chat visiable.
*
* {
* type: CHAT_KEYS_ARRIVED
* }
*/
export const CHAT_KEYS_ARRIVED = 'CHAT_KEYS_ARRIVED';
14 changes: 14 additions & 0 deletions react/features/chat/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,14 @@ function _addChatMsgListener(conference: IJitsiConference, store: IStore) {
}
);

conference.on(
JitsiConferenceEvents.E2EE_CHAT_KEY_RECEIVED,
() => {
_onKeyReceived(store);
}
);


conference.on(
JitsiConferenceEvents.PRIVATE_MESSAGE_RECEIVED,
(participantId: string, message: string, timestamp: number, messageId: string, displayName?: string, isFromVisitor?: boolean) => {
Expand Down Expand Up @@ -481,6 +489,12 @@ function _onReactionReceived(store: IStore, { participantId, reactionList, messa
store.dispatch(addMessageReaction(reactionPayload));
}

function _onKeyReceived(store: IStore) {
store.dispatch({
type: 'CHAT_KEYS_ARRIVED'
});
}

/**
* Handles a received gif message.
*
Expand Down
12 changes: 11 additions & 1 deletion react/features/chat/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { IVisitorChatParticipant } from '../visitors/types';
import {
ADD_MESSAGE,
ADD_MESSAGE_REACTION,
CHAT_KEYS_ARRIVED,
CLEAR_MESSAGES,
CLOSE_CHAT,
EDIT_MESSAGE,
Expand Down Expand Up @@ -40,14 +41,16 @@ const DEFAULT_STATE = {
width: {
current: CHAT_SIZE,
userSet: null
}
},
isKeysArrived: false
};

export interface IChatState {
focusedTab: ChatTabs;
groupChatWithPermissions: boolean;
isLobbyChatActive: boolean;
isOpen: boolean;
isKeysArrived: boolean;
isResizing: boolean;
lastReadMessage?: IMessage;
lobbyMessageRecipient?: {
Expand Down Expand Up @@ -184,6 +187,13 @@ ReducerRegistry.register<IChatState>('features/chat', (state = DEFAULT_STATE, ac
privateMessageRecipient: action.participant
};

case CHAT_KEYS_ARRIVED:
return {
...state,
isKeysArrived: true,
privateMessageRecipient: action.participant
};

case CLOSE_CHAT:
return {
...state,
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11122,9 +11122,9 @@ levn@^0.4.1:
prelude-ls "^1.2.1"
type-check "~0.4.0"

"lib-jitsi-meet@https://github.com/internxt/lib-jitsi-meet/releases/download/v.0.0.13/lib-jitsi-meet-0.0.13.tgz":
version "0.0.13"
resolved "https://github.com/internxt/lib-jitsi-meet/releases/download/v.0.0.13/lib-jitsi-meet-0.0.13.tgz#8ec080d2c7f70fd78b769c49cce7515ec22a75c9"
"lib-jitsi-meet@https://github.com/internxt/lib-jitsi-meet/releases/download/v.0.0.15/lib-jitsi-meet-0.0.15.tgz":
version "0.0.15"
resolved "https://github.com/internxt/lib-jitsi-meet/releases/download/v.0.0.15/lib-jitsi-meet-0.0.15.tgz#bf9f183d244e0fa0a14c3c0e5a76a7b6cba0d55e"
dependencies:
"@hexagon/base64" "^2.0.4"
"@jitsi/js-utils" "^2.6.7"
Expand Down