|
@@ -27,6 +27,7 @@ import {
|
27
|
27
|
import { updateSettings } from '../../react/features/base/settings';
|
28
|
28
|
import { isToggleCameraEnabled, toggleCamera } from '../../react/features/base/tracks';
|
29
|
29
|
import {
|
|
30
|
+ sendMessage,
|
30
|
31
|
setPrivateMessageRecipient,
|
31
|
32
|
toggleChat
|
32
|
33
|
} from '../../react/features/chat/actions';
|
|
@@ -241,6 +242,24 @@ function initCommands() {
|
241
|
242
|
sendAnalytics(createApiEvent('avatar.url.changed'));
|
242
|
243
|
APP.conference.changeLocalAvatarUrl(avatarUrl);
|
243
|
244
|
},
|
|
245
|
+ 'send-chat-message': (message, to, ignorePrivacy = false) => {
|
|
246
|
+ logger.debug('Send chat message command received');
|
|
247
|
+ if (to) {
|
|
248
|
+ const participant = getParticipantById(APP.store.getState(), to);
|
|
249
|
+
|
|
250
|
+ if (participant) {
|
|
251
|
+ APP.store.dispatch(setPrivateMessageRecipient(participant));
|
|
252
|
+ } else {
|
|
253
|
+ logger.error(`Participant with id ${to} not found!`);
|
|
254
|
+
|
|
255
|
+ return;
|
|
256
|
+ }
|
|
257
|
+ } else {
|
|
258
|
+ APP.store.dispatch(setPrivateMessageRecipient());
|
|
259
|
+ }
|
|
260
|
+
|
|
261
|
+ APP.store.dispatch(sendMessage(message, ignorePrivacy));
|
|
262
|
+ },
|
244
|
263
|
'send-endpoint-text-message': (to, text) => {
|
245
|
264
|
logger.debug('Send endpoint message command received');
|
246
|
265
|
try {
|