Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
d7c1342
improve: videoconf messages ui
dougfabris Aug 11, 2022
07e8c04
Merge branch 'develop' into improve/videoconf-messages
dougfabris Aug 17, 2022
1264ae4
new: message skeleton
dougfabris Aug 18, 2022
8a2d435
chore: Review Component
ggazzo Aug 18, 2022
2857915
Merge remote-tracking branch 'origin/develop' into improve/videoconf-…
ggazzo Aug 19, 2022
4f8468f
Merge branch 'develop' of github.com:RocketChat/Rocket.Chat into impr…
ggazzo Aug 22, 2022
a5a9e62
WIP
ggazzo Aug 22, 2022
78ed0d3
ui-kit next
ggazzo Aug 22, 2022
5de626c
Merge branch 'develop' into improve/videoconf-messages
dougfabris Aug 22, 2022
dbecf6d
wip
ggazzo Aug 23, 2022
c946632
Merge branch 'develop' into improve/videoconf-messages
dougfabris Aug 23, 2022
c17c1c9
Merge branch 'improve/videoconf-messages' of github.com:RocketChat/Ro…
ggazzo Aug 23, 2022
dfbcdb8
WIP
ggazzo Aug 23, 2022
0a3f457
Dedupe dependencies
tassoevan Aug 24, 2022
d7a6a34
dedupe
ggazzo Aug 24, 2022
08f158f
Dedupe more dependencies
tassoevan Aug 24, 2022
b4e237d
Merge branch 'develop' of github.com:RocketChat/Rocket.Chat into impr…
tassoevan Aug 24, 2022
c80433f
fix multiple react
ggazzo Aug 24, 2022
ec6d254
Merge branch 'improve/videoconf-messages' of github.com:RocketChat/Ro…
ggazzo Aug 24, 2022
78350e1
fix: block fixes
dougfabris Aug 25, 2022
f4c3eb4
fix: services
dougfabris Aug 25, 2022
2f471b9
fix: livechat ui-kit version
dougfabris Aug 25, 2022
bc69d60
Merge branch 'develop' into improve/videoconf-messages
dougfabris Aug 25, 2022
381af26
chore: avatar tooltip
dougfabris Aug 29, 2022
0b95bab
Merge branch 'develop' into improve/videoconf-messages
dougfabris Aug 29, 2022
81e1467
Adjust message creation
pierre-lehnen-rc Aug 31, 2022
aec2c06
Merge branch 'improve/videoconf-messages' of github.com:RocketChat/Ro…
pierre-lehnen-rc Aug 31, 2022
391a2a5
Restored livechat message
pierre-lehnen-rc Aug 31, 2022
7faf4ab
Fix for livechat widget
pierre-lehnen-rc Aug 31, 2022
a2a8ea5
Message update
pierre-lehnen-rc Sep 1, 2022
abbb25a
Merge remote-tracking branch 'origin/develop' into improve/videoconf-…
ggazzo Sep 15, 2022
6e288e4
review
ggazzo Sep 15, 2022
1d1b4a8
Merge remote-tracking branch 'origin/develop' into improve/videoconf-…
ggazzo Sep 16, 2022
f47062a
lint
ggazzo Sep 16, 2022
aaa8951
types
pierre-lehnen-rc Sep 21, 2022
2b7997b
Merge branch 'develop' into improve/videoconf-messages
kodiakhq[bot] Sep 22, 2022
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
39 changes: 35 additions & 4 deletions apps/meteor/client/views/blocks/MessageBlock.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import { UIKitIncomingInteractionContainerType } from '@rocket.chat/apps-engine/definition/uikit/UIKitIncomingInteractionContainer';
import { useMutableCallback } from '@rocket.chat/fuselage-hooks';
import { UiKitMessage, UiKitComponent, kitContext, messageParser } from '@rocket.chat/fuselage-ui-kit';
import React from 'react';

import * as ActionManager from '../../../app/ui-message/client/ActionManager';
import { useBlockRendered } from '../../components/message/hooks/useBlockRendered';
import { useVideoConfJoinCall, useVideoConfSetPreferences } from '../../contexts/VideoConfContext';
import {
useVideoConfJoinCall,
useVideoConfSetPreferences,
useVideoConfIsCalling,
useVideoConfIsRinging,
useVideoConfDispatchOutgoing,
} from '../../contexts/VideoConfContext';
import { VideoConfManager } from '../../lib/VideoConfManager';
import { renderMessageBody } from '../../lib/utils/renderMessageBody';
import './textParsers';
import { useVideoConfWarning } from '../room/contextualBar/VideoConference/useVideoConfWarning';

// TODO: move this to fuselage-ui-kit itself
const mrkdwn = ({ text } = {}) => text && <span dangerouslySetInnerHTML={{ __html: renderMessageBody({ msg: text }) }} />;
Expand All @@ -16,14 +25,36 @@ function MessageBlock({ mid: _mid, rid, blocks, appId }) {
const { ref, className } = useBlockRendered();
const joinCall = useVideoConfJoinCall();
const setPreferences = useVideoConfSetPreferences();
const isCalling = useVideoConfIsCalling();
const isRinging = useVideoConfIsRinging();
const dispatchWarning = useVideoConfWarning();
const dispatchPopup = useVideoConfDispatchOutgoing();

const handleOpenVideoConf = useMutableCallback(async (rid) => {
if (isCalling || isRinging) {
return;
}

try {
await VideoConfManager.loadCapabilities();
dispatchPopup({ rid });
} catch (error) {
dispatchWarning(error.error);
}
});

const context = {
action: ({ actionId, value, blockId, mid = _mid, appId }, event) => {
if (appId === 'videoconf-core' && actionId === 'join') {
if (appId === 'videoconf-core') {
event.preventDefault();
setPreferences({ mic: true, cam: false });
joinCall(blockId);
return;
if (actionId === 'join') {
return joinCall(blockId);
}

if (actionId === 'callBack') {
return handleOpenVideoConf(blockId);
}
}

ActionManager.triggerBlockAction({
Expand Down
10 changes: 5 additions & 5 deletions apps/meteor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@
"email": "support@rocket.chat"
},
"devDependencies": {
"@babel/core": "^7.18.9",
"@babel/core": "^7.18.13",
"@babel/eslint-parser": "^7.18.9",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
"@babel/plugin-proposal-optional-chaining": "^7.18.9",
"@babel/preset-env": "^7.18.9",
"@babel/preset-env": "^7.18.10",
"@babel/preset-react": "^7.18.6",
"@babel/register": "^7.18.9",
"@faker-js/faker": "^6.3.1",
Expand Down Expand Up @@ -125,7 +125,7 @@
"@types/prometheus-gc-stats": "^0.6.2",
"@types/proxyquire": "^1.3.28",
"@types/psl": "^1.1.0",
"@types/react": "~17.0.47",
"@types/react": "~17.0.48",
"@types/react-dom": "~17.0.17",
"@types/rewire": "^2.5.28",
"@types/semver": "^7.3.10",
Expand Down Expand Up @@ -153,7 +153,7 @@
"chai-spies": "^1.0.0",
"cross-env": "^7.0.3",
"emojione-assets": "^4.5.0",
"eslint": "^8.20.0",
"eslint": "^8.22.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.2.1",
Expand Down Expand Up @@ -211,7 +211,7 @@
"@rocket.chat/fuselage-polyfills": "next",
"@rocket.chat/fuselage-toastbar": "next",
"@rocket.chat/fuselage-tokens": "next",
"@rocket.chat/fuselage-ui-kit": "next",
"@rocket.chat/fuselage-ui-kit": "workspace:^",
"@rocket.chat/gazzodown": "workspace:^",
"@rocket.chat/icons": "next",
"@rocket.chat/layout": "next",
Expand Down
4 changes: 4 additions & 0 deletions apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,7 @@
"By_author": "By __author__",
"cache_cleared": "Cache cleared",
"Call": "Call",
"Call_back": "Call back",
"Calling": "Calling",
"Call_Center": "Voice Channel",
"Call_Center_Description": "Configure Rocket.Chat's voice channels",
Expand All @@ -780,7 +781,9 @@
"Call_number_enterprise_only": "Call number (Enterprise Edition only)",
"call-management": "Call Management",
"call-management_description": "Permission to start a meeting",
"Call_ongoing": "Call ongoing",
"Call_unavailable_for_federation": "Call is unavailable for Federated rooms",
"Call_was_not_answered": "Call was not answered",
"Caller": "Caller",
"Caller_Id": "Caller ID",
"Cam_on": "Cam On",
Expand Down Expand Up @@ -5232,6 +5235,7 @@
"VoIP_Toggle": "Enable/Disable VoIP",
"Chat_opened_by_visitor": "Chat opened by the visitor",
"Wait_activation_warning": "Before you can login, your account must be manually activated by an administrator.",
"Waiting_for_answer": "Waiting for answer",
"Waiting_queue": "Waiting queue",
"Waiting_queue_message": "Waiting queue message",
"Waiting_queue_message_description": "Message that will be displayed to the visitors when they get in the queue",
Expand Down
5 changes: 4 additions & 1 deletion apps/meteor/server/models/raw/VideoConference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,10 @@ export class VideoConferenceRaw extends BaseRaw<VideoConference> implements IVid
});
}

public async addUserById(callId: string, user: Pick<IUser, '_id' | 'name' | 'username' | 'avatarETag'> & { ts?: Date }): Promise<void> {
public async addUserById(
callId: string,
user: Required<Pick<IUser, '_id' | 'name' | 'username' | 'avatarETag'>> & { ts?: Date },
): Promise<void> {
await this.updateOneById(callId, {
$addToSet: {
users: {
Expand Down
6 changes: 6 additions & 0 deletions apps/meteor/server/modules/listeners/listeners.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ export class ListenersModule {
notifications.streamRoomMessage.emitWithoutBroadcast(message.rid, message);
});

service.onEvent('message.update', ({ message }) => {
if (message.rid) {
notifications.streamRoomMessage.emitWithoutBroadcast(message.rid, message);
}
});

service.onEvent('watch.subscriptions', ({ clientAction, subscription }) => {
if (!subscription.u?._id) {
return;
Expand Down
2 changes: 2 additions & 0 deletions apps/meteor/server/sdk/lib/Events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import type {
IWebdavAccount,
ICustomSound,
VoipEventDataSignature,
AtLeast,
UserStatus,
} from '@rocket.chat/core-typings';

Expand Down Expand Up @@ -136,4 +137,5 @@ export type EventSignatures = {
'call.callerhangup'(userId: string, data: { roomId: string }): void;
'watch.pbxevents'(data: { clientAction: ClientAction; data: Partial<IPbxEvent>; id: string }): void;
'connector.statuschanged'(enabled: boolean): void;
'message.update'(data: { message: AtLeast<IMessage, 'rid'> }): void;
};
Loading