Skip to content

Commit d36dcd2

Browse files
authored
Patch Jitsi logs into rageshakes (#22270)
* Patch Jitsi logs into rageshakes * Remove unused import * Fix types
1 parent ff7398b commit d36dcd2

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/vector/jitsi/index.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,8 @@ function joinConference(audioDevice?: string, videoDevice?: string) {
357357
startAudioOnly,
358358
startWithAudioMuted: audioDevice == null,
359359
startWithVideoMuted: videoDevice == null,
360+
// Request all log levels for inclusion in rageshakes
361+
apiLogLevels: ["warn", "log", "error", "info", "debug"],
360362
} as any,
361363
jwt: jwt,
362364
};
@@ -411,7 +413,7 @@ function joinConference(audioDevice?: string, videoDevice?: string) {
411413

412414
meetApi.on("audioMuteStatusChanged", ({ muted }) => {
413415
const action = muted ? ElementWidgetActions.MuteAudio : ElementWidgetActions.UnmuteAudio;
414-
widgetApi.transport.send(action, {});
416+
widgetApi?.transport.send(action, {});
415417
});
416418

417419
meetApi.on("videoMuteStatusChanged", ({ muted }) => {
@@ -421,10 +423,10 @@ function joinConference(audioDevice?: string, videoDevice?: string) {
421423
// otherwise the React SDK will mistakenly think the user turned off
422424
// their video by hand
423425
setTimeout(() => {
424-
if (meetApi) widgetApi.transport.send(ElementWidgetActions.MuteVideo, {});
426+
if (meetApi) widgetApi?.transport.send(ElementWidgetActions.MuteVideo, {});
425427
}, 200);
426428
} else {
427-
widgetApi.transport.send(ElementWidgetActions.UnmuteVideo, {});
429+
widgetApi?.transport.send(ElementWidgetActions.UnmuteVideo, {});
428430
}
429431
});
430432

@@ -435,4 +437,9 @@ function joinConference(audioDevice?: string, videoDevice?: string) {
435437
});
436438
});
437439
});
440+
441+
// Patch logs into rageshakes
442+
meetApi.on("log", ({ logLevel, args }) =>
443+
(parent as unknown as typeof global).mx_rage_logger?.log(logLevel, ...args),
444+
);
438445
}

0 commit comments

Comments
 (0)