From 34417ef1631ea365a67d6d946b734f1f9891c523 Mon Sep 17 00:00:00 2001 From: Estelle Comment Date: Tue, 20 Feb 2024 16:21:27 +0100 Subject: [PATCH 01/11] Add bug report button after voip calls --- .../tchap_translations.json | 4 ++ .../matrix-react-sdk+3.92.0.patch | 45 +++++++++++++++++++ patches/patches.json | 7 +-- 3 files changed, 53 insertions(+), 3 deletions(-) diff --git a/modules/tchap-translations/tchap_translations.json b/modules/tchap-translations/tchap_translations.json index 3d8cfac19d..766badaa70 100644 --- a/modules/tchap-translations/tchap_translations.json +++ b/modules/tchap-translations/tchap_translations.json @@ -713,5 +713,9 @@ "widget|error_need_kick_permission": { "en": "You need to be able to kick users to do that.", "fr": "Vous devez avoir l’autorisation de retirer des utilisateurs pour faire ceci." + }, + "Report a problem": { + "en": "Report a problem", + "fr": "Signaler un problème" } } diff --git a/patches/bug-reporting/matrix-react-sdk+3.92.0.patch b/patches/bug-reporting/matrix-react-sdk+3.92.0.patch index 425a9e57b0..35b3b97cb0 100644 --- a/patches/bug-reporting/matrix-react-sdk+3.92.0.patch +++ b/patches/bug-reporting/matrix-react-sdk+3.92.0.patch @@ -144,6 +144,51 @@ index 1eb0379..90955dd 100644 }; /** +diff --git a/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx b/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx +index 3c8241d..6405217 100644 +--- a/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx ++++ b/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx +@@ -28,6 +28,9 @@ import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; + import { formatPreciseDuration } from "../../../DateUtils"; + import Clock from "../audio_messages/Clock"; + ++import Modal from "matrix-react-sdk/src/Modal"; // :TCHAP: ++import BugReportDialog from "matrix-react-sdk/src/components/views/dialogs/BugReportDialog"; // :TCHAP: ++ + const MAX_NON_NARROW_WIDTH = (450 / 70) * 100; + + interface IProps { +@@ -264,6 +267,22 @@ export default class LegacyCallEvent extends React.PureComponent + ); + } + ++ private onReportBugClick = (): void => { ++ Modal.createDialog(BugReportDialog, {}); ++ }; ++ ++ private renderBugReportButton(): JSX.Element { ++ return ( ++ ++ {_t("Report a problem")} ++ ++ ); ++ } ++ + public render(): React.ReactNode { + const event = this.props.mxEvent; + const sender = event.sender ? event.sender.name : event.getSender(); +@@ -300,6 +319,7 @@ export default class LegacyCallEvent extends React.PureComponent + + + {content} ++ {this.renderBugReportButton()} + + + ); diff --git a/node_modules/matrix-react-sdk/src/rageshake/submit-rageshake.ts b/node_modules/matrix-react-sdk/src/rageshake/submit-rageshake.ts index d15f3d9..7c7f6d8 100644 --- a/node_modules/matrix-react-sdk/src/rageshake/submit-rageshake.ts diff --git a/patches/patches.json b/patches/patches.json index d4aafa295f..7cc175e65d 100644 --- a/patches/patches.json +++ b/patches/patches.json @@ -17,12 +17,13 @@ }, "bug-reporting": { "package": "matrix-react-sdk", - "github-issue":"https://github.com/tchapgouv/tchap-web-v4/issues/527, https://github.com/tchapgouv/tchap-web-v4/issues/526", - "comments" : "add email in rageshake", + "github-issue":"https://github.com/tchapgouv/tchap-web-v4/issues/527, https://github.com/tchapgouv/tchap-web-v4/issues/526, https://github.com/tchapgouv/tchap-product/issues/267", + "comments" : "add email in rageshake + voip", "files": [ "src/components/views/dialogs/BugReportDialog.tsx", "src/rageshake/submit-rageshake.ts", - "src/components/views/elements/AccessibleButton.tsx" + "src/components/views/elements/AccessibleButton.tsx", + "src/components/views/messages/LegacyCallEvent.tsx" ] }, "content-scanner": { From edd7670b3898f77589d00ed4600883542ad6df04 Mon Sep 17 00:00:00 2001 From: Estelle Comment Date: Tue, 20 Feb 2024 16:46:43 +0100 Subject: [PATCH 02/11] Customize text to suggest questions --- modules/tchap-translations/tchap_translations.json | 4 ++++ patches/bug-reporting/matrix-react-sdk+3.92.0.patch | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/tchap-translations/tchap_translations.json b/modules/tchap-translations/tchap_translations.json index 766badaa70..99c27b42b8 100644 --- a/modules/tchap-translations/tchap_translations.json +++ b/modules/tchap-translations/tchap_translations.json @@ -717,5 +717,9 @@ "Report a problem": { "en": "Report a problem", "fr": "Signaler un problème" + }, + "tchap_voip_bug_report_prefill": { + "en": "Congratulations, your account has been renewed", + "fr": "Sujet: problème sur appel Tchap. \nPouver-vous donner des détails?\n\nJe suis connecté en : WIFI / VPN / sur la 4G d'un portable / AUTRE\nJe suis sur : AU TRAVAIL / AILLEURS\nDétails du problème : ..." } } diff --git a/patches/bug-reporting/matrix-react-sdk+3.92.0.patch b/patches/bug-reporting/matrix-react-sdk+3.92.0.patch index 35b3b97cb0..a1a05b82f4 100644 --- a/patches/bug-reporting/matrix-react-sdk+3.92.0.patch +++ b/patches/bug-reporting/matrix-react-sdk+3.92.0.patch @@ -145,7 +145,7 @@ index 1eb0379..90955dd 100644 /** diff --git a/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx b/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx -index 3c8241d..6405217 100644 +index 3c8241d..a8fb0fd 100644 --- a/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx +++ b/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx @@ -28,6 +28,9 @@ import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; @@ -158,12 +158,14 @@ index 3c8241d..6405217 100644 const MAX_NON_NARROW_WIDTH = (450 / 70) * 100; interface IProps { -@@ -264,6 +267,22 @@ export default class LegacyCallEvent extends React.PureComponent +@@ -264,6 +267,24 @@ export default class LegacyCallEvent extends React.PureComponent ); } + private onReportBugClick = (): void => { -+ Modal.createDialog(BugReportDialog, {}); ++ Modal.createDialog(BugReportDialog, { ++ initialText: _t("tchap_voip_bug_report_prefill"), ++ }); + }; + + private renderBugReportButton(): JSX.Element { @@ -181,7 +183,7 @@ index 3c8241d..6405217 100644 public render(): React.ReactNode { const event = this.props.mxEvent; const sender = event.sender ? event.sender.name : event.getSender(); -@@ -300,6 +319,7 @@ export default class LegacyCallEvent extends React.PureComponent +@@ -300,6 +321,7 @@ export default class LegacyCallEvent extends React.PureComponent {content} From 6b13aa02418dcb408c1f14138f461860b61f68b5 Mon Sep 17 00:00:00 2001 From: Estelle Comment Date: Tue, 20 Feb 2024 16:48:02 +0100 Subject: [PATCH 03/11] Add label voip --- patches/bug-reporting/matrix-react-sdk+3.92.0.patch | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/patches/bug-reporting/matrix-react-sdk+3.92.0.patch b/patches/bug-reporting/matrix-react-sdk+3.92.0.patch index a1a05b82f4..a8528b6cee 100644 --- a/patches/bug-reporting/matrix-react-sdk+3.92.0.patch +++ b/patches/bug-reporting/matrix-react-sdk+3.92.0.patch @@ -145,7 +145,7 @@ index 1eb0379..90955dd 100644 /** diff --git a/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx b/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx -index 3c8241d..a8fb0fd 100644 +index 3c8241d..e947b3b 100644 --- a/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx +++ b/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx @@ -28,6 +28,9 @@ import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; @@ -158,13 +158,14 @@ index 3c8241d..a8fb0fd 100644 const MAX_NON_NARROW_WIDTH = (450 / 70) * 100; interface IProps { -@@ -264,6 +267,24 @@ export default class LegacyCallEvent extends React.PureComponent +@@ -264,6 +267,25 @@ export default class LegacyCallEvent extends React.PureComponent ); } + private onReportBugClick = (): void => { + Modal.createDialog(BugReportDialog, { + initialText: _t("tchap_voip_bug_report_prefill"), ++ label: "voip", + }); + }; + @@ -183,7 +184,7 @@ index 3c8241d..a8fb0fd 100644 public render(): React.ReactNode { const event = this.props.mxEvent; const sender = event.sender ? event.sender.name : event.getSender(); -@@ -300,6 +321,7 @@ export default class LegacyCallEvent extends React.PureComponent +@@ -300,6 +322,7 @@ export default class LegacyCallEvent extends React.PureComponent {content} From 62ecc18c24a97a904ff708c95a10682f9a8ae66a Mon Sep 17 00:00:00 2001 From: Estelle Comment Date: Tue, 20 Feb 2024 17:12:22 +0100 Subject: [PATCH 04/11] Style button properly --- .../matrix-react-sdk+3.92.0.patch | 25 ++++++++++--------- .../views/messages/TchapLegacyCallEvent.pcss | 9 +++++++ 2 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 res/css/views/messages/TchapLegacyCallEvent.pcss diff --git a/patches/bug-reporting/matrix-react-sdk+3.92.0.patch b/patches/bug-reporting/matrix-react-sdk+3.92.0.patch index a8528b6cee..f611a78f0f 100644 --- a/patches/bug-reporting/matrix-react-sdk+3.92.0.patch +++ b/patches/bug-reporting/matrix-react-sdk+3.92.0.patch @@ -145,20 +145,29 @@ index 1eb0379..90955dd 100644 /** diff --git a/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx b/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx -index 3c8241d..e947b3b 100644 +index 3c8241d..414e7cd 100644 --- a/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx +++ b/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx -@@ -28,6 +28,9 @@ import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; +@@ -28,6 +28,10 @@ import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; import { formatPreciseDuration } from "../../../DateUtils"; import Clock from "../audio_messages/Clock"; +import Modal from "matrix-react-sdk/src/Modal"; // :TCHAP: +import BugReportDialog from "matrix-react-sdk/src/components/views/dialogs/BugReportDialog"; // :TCHAP: ++import "../../../../../../res/css/views/messages/TchapLegacyCallEvent.pcss"; // :TCHAP: + const MAX_NON_NARROW_WIDTH = (450 / 70) * 100; interface IProps { -@@ -264,6 +267,25 @@ export default class LegacyCallEvent extends React.PureComponent +@@ -192,6 +196,7 @@ export default class LegacyCallEvent extends React.PureComponent + return ( +
+ {text} ++ {this.renderBugReportButton()} + {this.props.timestamp} +
+ ); +@@ -264,6 +269,25 @@ export default class LegacyCallEvent extends React.PureComponent ); } @@ -172,7 +181,7 @@ index 3c8241d..e947b3b 100644 + private renderBugReportButton(): JSX.Element { + return ( + @@ -184,14 +193,6 @@ index 3c8241d..e947b3b 100644 public render(): React.ReactNode { const event = this.props.mxEvent; const sender = event.sender ? event.sender.name : event.getSender(); -@@ -300,6 +322,7 @@ export default class LegacyCallEvent extends React.PureComponent - - - {content} -+ {this.renderBugReportButton()} - - - ); diff --git a/node_modules/matrix-react-sdk/src/rageshake/submit-rageshake.ts b/node_modules/matrix-react-sdk/src/rageshake/submit-rageshake.ts index d15f3d9..7c7f6d8 100644 --- a/node_modules/matrix-react-sdk/src/rageshake/submit-rageshake.ts diff --git a/res/css/views/messages/TchapLegacyCallEvent.pcss b/res/css/views/messages/TchapLegacyCallEvent.pcss new file mode 100644 index 0000000000..655b749a1b --- /dev/null +++ b/res/css/views/messages/TchapLegacyCallEvent.pcss @@ -0,0 +1,9 @@ +.mx_LegacyCallEvent_wrapper { + .mx_LegacyCallEvent { + &.mx_LegacyCallEvent_voice { + .mx_LegacyCallEvent_content_button_reportBug span::before { + mask-image: url("~matrix-react-sdk/res/img/feather-customised/bug.svg"); + } + } + } +} \ No newline at end of file From 3bcb77e911b91bad093dbcd66987c16c427cdae9 Mon Sep 17 00:00:00 2001 From: Estelle Comment Date: Tue, 20 Feb 2024 17:22:32 +0100 Subject: [PATCH 05/11] Pass "context:voip" field in rageshake --- .../bug-reporting/matrix-react-sdk+3.92.0.patch | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/patches/bug-reporting/matrix-react-sdk+3.92.0.patch b/patches/bug-reporting/matrix-react-sdk+3.92.0.patch index f611a78f0f..6eca32df87 100644 --- a/patches/bug-reporting/matrix-react-sdk+3.92.0.patch +++ b/patches/bug-reporting/matrix-react-sdk+3.92.0.patch @@ -1,5 +1,5 @@ diff --git a/node_modules/matrix-react-sdk/src/components/views/dialogs/BugReportDialog.tsx b/node_modules/matrix-react-sdk/src/components/views/dialogs/BugReportDialog.tsx -index 5d826f2..5163137 100644 +index 5d826f2..e3ec671 100644 --- a/node_modules/matrix-react-sdk/src/components/views/dialogs/BugReportDialog.tsx +++ b/node_modules/matrix-react-sdk/src/components/views/dialogs/BugReportDialog.tsx @@ -32,6 +32,7 @@ import DialogButtons from "../elements/DialogButtons"; @@ -32,7 +32,7 @@ index 5d826f2..5163137 100644 const userText = (this.state.text.length > 0 ? this.state.text + "\n\n" : "") + -@@ -111,11 +121,24 @@ export default class BugReportDialog extends React.Component { +@@ -111,11 +121,28 @@ export default class BugReportDialog extends React.Component { this.setState({ busy: true, progress: null, err: null }); this.sendProgressCallback(_t("bug_reporting|preparing_logs")); @@ -48,6 +48,10 @@ index 5d826f2..5163137 100644 + result.threepids.forEach(threepid => { + return customFields[threepid.medium] = threepid.address; + }); ++ // is this a voip report ? Add it in "context" field ++ if (this.props.label === 'voip') { ++ customFields.context = 'voip'; ++ } + return customFields; + }).then(customFields => { + return sendBugReport(SdkConfig.get().bug_report_endpoint_url, { @@ -62,7 +66,7 @@ index 5d826f2..5163137 100644 }).then( () => { if (!this.unmounted) { -@@ -150,6 +173,7 @@ export default class BugReportDialog extends React.Component { +@@ -150,6 +177,7 @@ export default class BugReportDialog extends React.Component { sendLogs: true, progressCallback: this.downloadProgressCallback, labels: this.props.label ? [this.props.label] : [], @@ -70,7 +74,7 @@ index 5d826f2..5163137 100644 }); this.setState({ -@@ -214,6 +238,53 @@ export default class BugReportDialog extends React.Component { +@@ -214,6 +242,53 @@ export default class BugReportDialog extends React.Component { ); } @@ -124,7 +128,7 @@ index 5d826f2..5163137 100644 return ( { +@@ -281,5 +356,6 @@ export default class BugReportDialog extends React.Component { /> ); From d22637821df36aa3aa9cec476933e3f959898da0 Mon Sep 17 00:00:00 2001 From: Estelle Comment Date: Thu, 22 Feb 2024 13:29:49 +0100 Subject: [PATCH 06/11] Change icon on button to "!" --- res/css/views/messages/TchapLegacyCallEvent.pcss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/css/views/messages/TchapLegacyCallEvent.pcss b/res/css/views/messages/TchapLegacyCallEvent.pcss index 655b749a1b..23046e63ff 100644 --- a/res/css/views/messages/TchapLegacyCallEvent.pcss +++ b/res/css/views/messages/TchapLegacyCallEvent.pcss @@ -2,7 +2,7 @@ .mx_LegacyCallEvent { &.mx_LegacyCallEvent_voice { .mx_LegacyCallEvent_content_button_reportBug span::before { - mask-image: url("~matrix-react-sdk/res/img/feather-customised/bug.svg"); + mask-image: url("~matrix-react-sdk/res/img/element-icons/warning-badge.svg"); } } } From e4200476629e89b200b9248ab130691aab5fee22 Mon Sep 17 00:00:00 2001 From: Estelle Comment Date: Thu, 22 Feb 2024 13:55:39 +0100 Subject: [PATCH 07/11] Add label "voip-feedback" and context "voip" --- patches/bug-reporting/matrix-react-sdk+3.92.0.patch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/patches/bug-reporting/matrix-react-sdk+3.92.0.patch b/patches/bug-reporting/matrix-react-sdk+3.92.0.patch index 6eca32df87..53ccc8c047 100644 --- a/patches/bug-reporting/matrix-react-sdk+3.92.0.patch +++ b/patches/bug-reporting/matrix-react-sdk+3.92.0.patch @@ -1,5 +1,5 @@ diff --git a/node_modules/matrix-react-sdk/src/components/views/dialogs/BugReportDialog.tsx b/node_modules/matrix-react-sdk/src/components/views/dialogs/BugReportDialog.tsx -index 5d826f2..e3ec671 100644 +index 5d826f2..c0008ea 100644 --- a/node_modules/matrix-react-sdk/src/components/views/dialogs/BugReportDialog.tsx +++ b/node_modules/matrix-react-sdk/src/components/views/dialogs/BugReportDialog.tsx @@ -32,6 +32,7 @@ import DialogButtons from "../elements/DialogButtons"; @@ -49,8 +49,8 @@ index 5d826f2..e3ec671 100644 + return customFields[threepid.medium] = threepid.address; + }); + // is this a voip report ? Add it in "context" field -+ if (this.props.label === 'voip') { -+ customFields.context = 'voip'; ++ if (this.props.label === "voip-feedback") { ++ customFields.context = "voip"; + } + return customFields; + }).then(customFields => { @@ -149,7 +149,7 @@ index 1eb0379..90955dd 100644 /** diff --git a/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx b/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx -index 3c8241d..414e7cd 100644 +index 3c8241d..cdd9a83 100644 --- a/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx +++ b/node_modules/matrix-react-sdk/src/components/views/messages/LegacyCallEvent.tsx @@ -28,6 +28,10 @@ import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; @@ -178,7 +178,7 @@ index 3c8241d..414e7cd 100644 + private onReportBugClick = (): void => { + Modal.createDialog(BugReportDialog, { + initialText: _t("tchap_voip_bug_report_prefill"), -+ label: "voip", ++ label: "voip-feedback", + }); + }; + From 172195946d17c2ddb91e512ccd101983ec8af78e Mon Sep 17 00:00:00 2001 From: Estelle Comment Date: Thu, 22 Feb 2024 15:54:41 +0100 Subject: [PATCH 08/11] Detect if there is Bluetooth audio input --- .../matrix-react-sdk+3.92.0.patch | 25 +++++++++------ src/tchap/util/TchapUtils.ts | 31 +++++++++++++++++++ 2 files changed, 47 insertions(+), 9 deletions(-) diff --git a/patches/bug-reporting/matrix-react-sdk+3.92.0.patch b/patches/bug-reporting/matrix-react-sdk+3.92.0.patch index 53ccc8c047..ce11718eab 100644 --- a/patches/bug-reporting/matrix-react-sdk+3.92.0.patch +++ b/patches/bug-reporting/matrix-react-sdk+3.92.0.patch @@ -1,16 +1,17 @@ diff --git a/node_modules/matrix-react-sdk/src/components/views/dialogs/BugReportDialog.tsx b/node_modules/matrix-react-sdk/src/components/views/dialogs/BugReportDialog.tsx -index 5d826f2..c0008ea 100644 +index 5d826f2..51baf28 100644 --- a/node_modules/matrix-react-sdk/src/components/views/dialogs/BugReportDialog.tsx +++ b/node_modules/matrix-react-sdk/src/components/views/dialogs/BugReportDialog.tsx -@@ -32,6 +32,7 @@ import DialogButtons from "../elements/DialogButtons"; +@@ -32,6 +32,8 @@ import DialogButtons from "../elements/DialogButtons"; import { sendSentryReport } from "../../../sentry"; import defaultDispatcher from "../../../dispatcher/dispatcher"; import { Action } from "../../../dispatcher/actions"; +import { MatrixClientPeg } from '../../../MatrixClientPeg'; // :TCHAP: ++import TchapUtils from "../../../../../../src/tchap/util/TchapUtils"; // :TCHAP: interface IProps { onFinished: (success: boolean) => void; -@@ -96,12 +97,21 @@ export default class BugReportDialog extends React.Component { +@@ -96,12 +98,21 @@ export default class BugReportDialog extends React.Component { }; private onSubmit = (): void => { @@ -32,7 +33,7 @@ index 5d826f2..c0008ea 100644 const userText = (this.state.text.length > 0 ? this.state.text + "\n\n" : "") + -@@ -111,11 +121,28 @@ export default class BugReportDialog extends React.Component { +@@ -111,11 +122,34 @@ export default class BugReportDialog extends React.Component { this.setState({ busy: true, progress: null, err: null }); this.sendProgressCallback(_t("bug_reporting|preparing_logs")); @@ -43,16 +44,22 @@ index 5d826f2..c0008ea 100644 - labels: this.props.label ? [this.props.label] : [], + // :TCHAP: customise report : add email, prefix with "tchap-web" + const client = MatrixClientPeg.get(); ++ const customFields = {}; + client.getThreePids().then(result => { -+ const customFields = {}; + result.threepids.forEach(threepid => { + return customFields[threepid.medium] = threepid.address; + }); ++ return customFields; ++ }).then(customFields => { + // is this a voip report ? Add it in "context" field + if (this.props.label === "voip-feedback") { + customFields.context = "voip"; + } -+ return customFields; ++ ++ return TchapUtils.isCurrentlyUsingBluetooth().then(isCurrentlyUsingBluetooth => { ++ customFields.audio_input = isCurrentlyUsingBluetooth ? "headset_bluetooth" : "device"; ++ return customFields; ++ }) + }).then(customFields => { + return sendBugReport(SdkConfig.get().bug_report_endpoint_url, { + userText, @@ -66,7 +73,7 @@ index 5d826f2..c0008ea 100644 }).then( () => { if (!this.unmounted) { -@@ -150,6 +177,7 @@ export default class BugReportDialog extends React.Component { +@@ -150,6 +184,7 @@ export default class BugReportDialog extends React.Component { sendLogs: true, progressCallback: this.downloadProgressCallback, labels: this.props.label ? [this.props.label] : [], @@ -74,7 +81,7 @@ index 5d826f2..c0008ea 100644 }); this.setState({ -@@ -214,6 +242,53 @@ export default class BugReportDialog extends React.Component { +@@ -214,6 +249,53 @@ export default class BugReportDialog extends React.Component { ); } @@ -128,7 +135,7 @@ index 5d826f2..c0008ea 100644 return ( { +@@ -281,5 +363,6 @@ export default class BugReportDialog extends React.Component { /> ); diff --git a/src/tchap/util/TchapUtils.ts b/src/tchap/util/TchapUtils.ts index 1b1b3cfc9a..228f831bb4 100644 --- a/src/tchap/util/TchapUtils.ts +++ b/src/tchap/util/TchapUtils.ts @@ -238,4 +238,35 @@ export default class TchapUtils { } return false; } + + /** + * @returns true if we are sure user is currently using a bluetooth audio input. In many cases we don't know, and return false. + */ + static async isCurrentlyUsingBluetooth(): Promise { + if (!navigator.mediaDevices?.enumerateDevices) { + console.log("enumerateDevices() not supported. Cannot know if there is a bluetooth device."); + return false; + } else { + // List cameras and microphones. + return navigator.mediaDevices + .enumerateDevices() + .then((devices) => { + let hasBluetooth = false; + devices.forEach((device) => { + console.log(`${device.kind}: ${device.label} id = ${device.deviceId}`); + if (device.kind === "audioinput") { + if (device.label.toLowerCase().includes("bluetooth")) { + hasBluetooth = true; + } + } + }); + return hasBluetooth; + }) + .catch((err) => { + console.error(`${err.name}: ${err.message}`); + return false; + }); + } + } + } From 9844d9c77436fdbb54294f9ea50ef598704b4021 Mon Sep 17 00:00:00 2001 From: Estelle Comment Date: Thu, 22 Feb 2024 16:05:32 +0100 Subject: [PATCH 09/11] Update translation strings --- modules/tchap-translations/tchap_translations.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/tchap-translations/tchap_translations.json b/modules/tchap-translations/tchap_translations.json index 99c27b42b8..1975883996 100644 --- a/modules/tchap-translations/tchap_translations.json +++ b/modules/tchap-translations/tchap_translations.json @@ -719,7 +719,7 @@ "fr": "Signaler un problème" }, "tchap_voip_bug_report_prefill": { - "en": "Congratulations, your account has been renewed", - "fr": "Sujet: problème sur appel Tchap. \nPouver-vous donner des détails?\n\nJe suis connecté en : WIFI / VPN / sur la 4G d'un portable / AUTRE\nJe suis sur : AU TRAVAIL / AILLEURS\nDétails du problème : ..." + "en": "I had a problem during a Tchap call.\nDetails: ...", + "fr": "J'ai eu un problème pendant un appel Tchap.\nDétails : ..." } } From b0efbd02693e340b5906a8c40c7031c72a350b4f Mon Sep 17 00:00:00 2001 From: Estelle Comment Date: Thu, 22 Feb 2024 16:36:52 +0100 Subject: [PATCH 10/11] Better comment for bluetooth func --- src/tchap/util/TchapUtils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tchap/util/TchapUtils.ts b/src/tchap/util/TchapUtils.ts index 228f831bb4..e66b5f0c60 100644 --- a/src/tchap/util/TchapUtils.ts +++ b/src/tchap/util/TchapUtils.ts @@ -240,7 +240,9 @@ export default class TchapUtils { } /** - * @returns true if we are sure user is currently using a bluetooth audio input. In many cases we don't know, and return false. + * Whether the user is currently using a bluetooth audio input (bluetooth headset for example). + * In Chrome we can get the information, but in Firefox and Edge we don't know. + * @returns true if we are sure user is currently using a bluetooth audio input. False if no blutooth, or we don't know. */ static async isCurrentlyUsingBluetooth(): Promise { if (!navigator.mediaDevices?.enumerateDevices) { From cfd89095c064c2932959ae25e1830bc53e43e486 Mon Sep 17 00:00:00 2001 From: Estelle Comment Date: Thu, 22 Feb 2024 16:58:53 +0100 Subject: [PATCH 11/11] Betterer comment for bluetooth func --- src/tchap/util/TchapUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tchap/util/TchapUtils.ts b/src/tchap/util/TchapUtils.ts index e66b5f0c60..1a5087e07f 100644 --- a/src/tchap/util/TchapUtils.ts +++ b/src/tchap/util/TchapUtils.ts @@ -241,7 +241,7 @@ export default class TchapUtils { /** * Whether the user is currently using a bluetooth audio input (bluetooth headset for example). - * In Chrome we can get the information, but in Firefox and Edge we don't know. + * In Chrome we can get the information sometimes, and in Firefox and Edge we don't know. * @returns true if we are sure user is currently using a bluetooth audio input. False if no blutooth, or we don't know. */ static async isCurrentlyUsingBluetooth(): Promise {