From 25c3cd9b3d06f5cb1b5bf8d2e0e13823c7a1a21b Mon Sep 17 00:00:00 2001 From: James Burnside <2684369+JamesBurnside@users.noreply.github.com> Date: Tue, 10 Sep 2024 14:11:03 +0000 Subject: [PATCH 1/6] Support joining an existing call in the CallComposite --- .../adapter/AzureCommunicationCallAdapter.ts | 73 ++++++++++++------- .../composites/CallComposite/utils/Utils.ts | 16 ++-- 2 files changed, 55 insertions(+), 34 deletions(-) diff --git a/packages/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts b/packages/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts index 603af3421d7..2917562e4a1 100644 --- a/packages/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts +++ b/packages/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts @@ -95,7 +95,7 @@ import { } from './CallAdapter'; /* @conditional-compile-remove(teams-identity-support) */ import { TeamsCallAdapter } from './CallAdapter'; -import { getCallCompositePage, getLocatorOrTargetCallees, IsCallEndedPage, isCameraOn } from '../utils'; +import { getCallCompositePage, isCall, IsCallEndedPage, isCameraOn, isTargetCallees } from '../utils'; import { CreateVideoStreamViewResult, VideoStreamOptions } from '@internal/react-components'; import { toFlatCommunicationIdentifier, _toCommunicationIdentifier, _isValidIdentifier } from '@internal/acs-ui-common'; import { @@ -436,7 +436,14 @@ export class AzureCommunicationCallAdapter { if (isMicrosoftTeamsUserIdentifier(callee) || isMicrosoftTeamsAppIdentifier(callee)) { @@ -461,7 +473,7 @@ export class AzureCommunicationCallAdapter; +/** + * Implementation of overloads for {@link createAzureCommunicationCallAdapterFromClient}. + * + * @private + */ +export async function createAzureCommunicationCallAdapterFromClient( + callClient: StatefulCallClient, + callAgent: CallAgent, + overloadedParam: CallAdapterLocator | StartCallIdentifier[] | Call, options?: AzureCommunicationCallAdapterOptions ): Promise { const deviceManager = (await callClient.getDeviceManager()) as StatefulDeviceManager; @@ -2187,22 +2214,12 @@ export async function createAzureCommunicationCallAdapterFromClient( } /* @conditional-compile-remove(unsupported-browser) */ await callClient.feature(Features.DebugInfo).getEnvironmentInfo(); - if (getLocatorOrTargetCallees(locatorOrtargetCallees)) { - return new AzureCommunicationCallAdapter( - callClient, - locatorOrtargetCallees as StartCallIdentifier[], - callAgent, - deviceManager, - options - ); + if (isTargetCallees(overloadedParam)) { + return new AzureCommunicationCallAdapter(callClient, overloadedParam, callAgent, deviceManager, options); + } else if (isCall(overloadedParam)) { + return new AzureCommunicationCallAdapter(callClient, overloadedParam, callAgent, deviceManager, options); } else { - return new AzureCommunicationCallAdapter( - callClient, - locatorOrtargetCallees as CallAdapterLocator, - callAgent, - deviceManager, - options - ); + return new AzureCommunicationCallAdapter(callClient, overloadedParam, callAgent, deviceManager, options); } } diff --git a/packages/react-composites/src/composites/CallComposite/utils/Utils.ts b/packages/react-composites/src/composites/CallComposite/utils/Utils.ts index c015c65138d..e96d2b58f02 100644 --- a/packages/react-composites/src/composites/CallComposite/utils/Utils.ts +++ b/packages/react-composites/src/composites/CallComposite/utils/Utils.ts @@ -7,7 +7,7 @@ import { CallControlOptions } from '../types/CallControlOptions'; import { CallState, RemoteParticipantState } from '@internal/calling-stateful-client'; import { isPhoneNumberIdentifier } from '@azure/communication-common'; /* @conditional-compile-remove(unsupported-browser) */ -import { EnvironmentInfo } from '@azure/communication-calling'; +import { Call, EnvironmentInfo } from '@azure/communication-calling'; import { AdapterStateModifier, CallAdapterLocator } from '../adapter/AzureCommunicationCallAdapter'; import { VideoBackgroundEffectsDependency } from '@internal/calling-component-bindings'; @@ -587,14 +587,18 @@ export const getSelectedCameraFromAdapterState = (state: CallAdapterState): Vide /** * Helper to determine if the adapter has a locator or targetCallees - * @param locatorOrTargetCallees * @returns boolean to determine if the adapter has a locator or targetCallees, true is locator, false is targetCallees * @private */ -export const getLocatorOrTargetCallees = ( - locatorOrTargetCallees: CallAdapterLocator | StartCallIdentifier[] -): locatorOrTargetCallees is StartCallIdentifier[] => { - return !!Array.isArray(locatorOrTargetCallees); +export const isTargetCallees = ( + overloadedParam: CallAdapterLocator | StartCallIdentifier[] | Call +): overloadedParam is StartCallIdentifier[] => { + return !!Array.isArray(overloadedParam); +}; + +/** @private */ +export const isCall = (overloadedParam: CallAdapterLocator | StartCallIdentifier[] | Call): overloadedParam is Call => { + return 'kind' in overloadedParam && overloadedParam.kind === 'Call'; }; /** From 1d3d6446e0279852f694153689c5fbb4f1499152 Mon Sep 17 00:00:00 2001 From: James Burnside <2684369+JamesBurnside@users.noreply.github.com> Date: Tue, 10 Sep 2024 14:44:44 +0000 Subject: [PATCH 2/6] Update CallWithChat composite to support passing an existing call --- .../review/beta/communication-react.api.md | 15 ++++- .../review/stable/communication-react.api.md | 15 ++++- .../adapter/AzureCommunicationCallAdapter.ts | 7 +- .../composites/CallComposite/utils/Utils.ts | 4 +- .../AzureCommunicationCallWithChatAdapter.ts | 66 ++++++++++++++----- 5 files changed, 86 insertions(+), 21 deletions(-) diff --git a/packages/communication-react/review/beta/communication-react.api.md b/packages/communication-react/review/beta/communication-react.api.md index 05f531275f7..8765d57c325 100644 --- a/packages/communication-react/review/beta/communication-react.api.md +++ b/packages/communication-react/review/beta/communication-react.api.md @@ -2549,11 +2549,24 @@ export function createAzureCommunicationCallAdapterFromClient(callClient: Statef // @public export function createAzureCommunicationCallAdapterFromClient(callClient: StatefulCallClient, callAgent: CallAgent, locator: CallAdapterLocator, options?: AzureCommunicationCallAdapterOptions): Promise; +// @public +export function createAzureCommunicationCallAdapterFromClient(callClient: StatefulCallClient, callAgent: CallAgent, call: Call, options?: AzureCommunicationCallAdapterOptions): Promise; + // @public export const createAzureCommunicationCallWithChatAdapter: ({ userId, displayName, credential, endpoint, locator, alternateCallerId, callAdapterOptions }: AzureCommunicationCallWithChatAdapterArgs) => Promise; // @public -export const createAzureCommunicationCallWithChatAdapterFromClients: ({ callClient, callAgent, callLocator, chatClient, chatThreadClient, callAdapterOptions }: AzureCommunicationCallWithChatAdapterFromClientArgs) => Promise; +export function createAzureCommunicationCallWithChatAdapterFromClients(args: AzureCommunicationCallWithChatAdapterFromClientArgs): Promise; + +// @public +export function createAzureCommunicationCallWithChatAdapterFromClients(args: { + callClient: StatefulCallClient; + callAgent: CallAgent; + call: Call; + chatClient: StatefulChatClient; + chatThreadClient: ChatThreadClient; + callAdapterOptions?: AzureCommunicationCallAdapterOptions; +}): Promise; // @public export const createAzureCommunicationChatAdapter: ({ endpoint: endpointUrl, userId, displayName, credential, threadId }: AzureCommunicationChatAdapterArgs) => Promise; diff --git a/packages/communication-react/review/stable/communication-react.api.md b/packages/communication-react/review/stable/communication-react.api.md index 2da409d2b3f..bdd98cb193a 100644 --- a/packages/communication-react/review/stable/communication-react.api.md +++ b/packages/communication-react/review/stable/communication-react.api.md @@ -2159,11 +2159,24 @@ export function createAzureCommunicationCallAdapterFromClient(callClient: Statef // @public export function createAzureCommunicationCallAdapterFromClient(callClient: StatefulCallClient, callAgent: CallAgent, locator: CallAdapterLocator, options?: AzureCommunicationCallAdapterOptions): Promise; +// @public +export function createAzureCommunicationCallAdapterFromClient(callClient: StatefulCallClient, callAgent: CallAgent, call: Call, options?: AzureCommunicationCallAdapterOptions): Promise; + // @public export const createAzureCommunicationCallWithChatAdapter: ({ userId, displayName, credential, endpoint, locator, alternateCallerId, callAdapterOptions }: AzureCommunicationCallWithChatAdapterArgs) => Promise; // @public -export const createAzureCommunicationCallWithChatAdapterFromClients: ({ callClient, callAgent, callLocator, chatClient, chatThreadClient, callAdapterOptions }: AzureCommunicationCallWithChatAdapterFromClientArgs) => Promise; +export function createAzureCommunicationCallWithChatAdapterFromClients(args: AzureCommunicationCallWithChatAdapterFromClientArgs): Promise; + +// @public +export function createAzureCommunicationCallWithChatAdapterFromClients(args: { + callClient: StatefulCallClient; + callAgent: CallAgent; + call: Call; + chatClient: StatefulChatClient; + chatThreadClient: ChatThreadClient; + callAdapterOptions?: AzureCommunicationCallAdapterOptions; +}): Promise; // @public export const createAzureCommunicationChatAdapter: ({ endpoint: endpointUrl, userId, displayName, credential, threadId }: AzureCommunicationChatAdapterArgs) => Promise; diff --git a/packages/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts b/packages/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts index 2917562e4a1..62b592d2364 100644 --- a/packages/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts +++ b/packages/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts @@ -473,7 +473,12 @@ export class AzureCommunicationCallAdapter { + /* @conditional-compile-remove(calling-beta-sdk) */ + return !!overloadedParamAsCall?.info.roomId; + return false; + }; + const isRoomsCall = this.locator ? 'roomId' in this.locator : isOverloadedParamARoomsCallTrampoline(); this.onResolveVideoBackgroundEffectsDependency = options?.videoBackgroundOptions?.onResolveDependency; /* @conditional-compile-remove(DNS) */ diff --git a/packages/react-composites/src/composites/CallComposite/utils/Utils.ts b/packages/react-composites/src/composites/CallComposite/utils/Utils.ts index e96d2b58f02..f454e7240be 100644 --- a/packages/react-composites/src/composites/CallComposite/utils/Utils.ts +++ b/packages/react-composites/src/composites/CallComposite/utils/Utils.ts @@ -7,7 +7,7 @@ import { CallControlOptions } from '../types/CallControlOptions'; import { CallState, RemoteParticipantState } from '@internal/calling-stateful-client'; import { isPhoneNumberIdentifier } from '@azure/communication-common'; /* @conditional-compile-remove(unsupported-browser) */ -import { Call, EnvironmentInfo } from '@azure/communication-calling'; +import { EnvironmentInfo } from '@azure/communication-calling'; import { AdapterStateModifier, CallAdapterLocator } from '../adapter/AzureCommunicationCallAdapter'; import { VideoBackgroundEffectsDependency } from '@internal/calling-component-bindings'; @@ -15,7 +15,7 @@ import { VideoBackgroundEffectsDependency } from '@internal/calling-component-bi import { VideoBackgroundEffect } from '../adapter/CallAdapter'; import { VideoDeviceInfo } from '@azure/communication-calling'; -import { VideoEffectProcessor } from '@azure/communication-calling'; +import { Call, VideoEffectProcessor } from '@azure/communication-calling'; import { CompositeLocale } from '../../localization'; import { CallCompositeIcons } from '../../common/icons'; diff --git a/packages/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.ts b/packages/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.ts index 6af47f66adf..8221b06841e 100644 --- a/packages/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.ts +++ b/packages/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.ts @@ -1394,7 +1394,6 @@ export type AzureCommunicationCallWithChatAdapterFromClientArgs = { callClient: StatefulCallClient; chatClient: StatefulChatClient; chatThreadClient: ChatThreadClient; - callAdapterOptions?: AzureCommunicationCallAdapterOptions; }; @@ -1407,24 +1406,59 @@ export type AzureCommunicationCallWithChatAdapterFromClientArgs = { * * @public */ -export const createAzureCommunicationCallWithChatAdapterFromClients = async ({ - callClient, - callAgent, - callLocator, - chatClient, - chatThreadClient, - callAdapterOptions -}: AzureCommunicationCallWithChatAdapterFromClientArgs): Promise => { - const callAdapter = await createAzureCommunicationCallAdapterFromClient( - callClient, - callAgent, - callLocator, +export async function createAzureCommunicationCallWithChatAdapterFromClients( + args: AzureCommunicationCallWithChatAdapterFromClientArgs +): Promise; + +/** + * Create a {@link CallWithChatAdapter} using the provided {@link StatefulChatClient} and {@link StatefulCallClient} and {@link Call}. + * + * Useful if you want to keep a reference to {@link StatefulChatClient} and {@link StatefulCallClient}. + * Please note that chatThreadClient has to be created by StatefulChatClient via chatClient.getChatThreadClient(chatThreadId) API. + * Consider using {@link createAzureCommunicationCallWithChatAdapter} for a simpler API. + * + * @public + */ +export async function createAzureCommunicationCallWithChatAdapterFromClients(args: { + callClient: StatefulCallClient; + callAgent: CallAgent; + call: Call; + chatClient: StatefulChatClient; + chatThreadClient: ChatThreadClient; + callAdapterOptions?: AzureCommunicationCallAdapterOptions; +}): Promise; + +/** + * Implementation of {@link createAzureCommunicationCallWithChatAdapterFromClients} overloads. + * @private + */ +export async function createAzureCommunicationCallWithChatAdapterFromClients( + args: + | AzureCommunicationCallWithChatAdapterFromClientArgs + | { + call: Call; + callAgent: CallAgent; + callClient: StatefulCallClient; + chatClient: StatefulChatClient; + chatThreadClient: ChatThreadClient; + callAdapterOptions?: AzureCommunicationCallAdapterOptions; + } +): Promise { + const { callAgent, callClient, chatClient, chatThreadClient, callAdapterOptions } = args; + + const callAdapter = + 'call' in args + ? await createAzureCommunicationCallAdapterFromClient(callClient, callAgent, args.call, callAdapterOptions) + : await createAzureCommunicationCallAdapterFromClient( + callClient, + callAgent, + args.callLocator, + callAdapterOptions + ); - callAdapterOptions - ); const chatAdapter = await createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient); return new AzureCommunicationCallWithChatAdapter(callAdapter, chatAdapter); -}; +} /** * Create a {@link CallWithChatAdapter} from the underlying adapters. From 70d73137159b2ec1654ea82adc15dd71dd7279bf Mon Sep 17 00:00:00 2001 From: James Burnside <2684369+JamesBurnside@users.noreply.github.com> Date: Tue, 10 Sep 2024 14:45:59 +0000 Subject: [PATCH 3/6] Change files --- ...ation-react-424e27fb-3ea9-4505-8fb2-2d7c0c28cd2c.json | 9 +++++++++ ...ation-react-424e27fb-3ea9-4505-8fb2-2d7c0c28cd2c.json | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 change-beta/@azure-communication-react-424e27fb-3ea9-4505-8fb2-2d7c0c28cd2c.json create mode 100644 change/@azure-communication-react-424e27fb-3ea9-4505-8fb2-2d7c0c28cd2c.json diff --git a/change-beta/@azure-communication-react-424e27fb-3ea9-4505-8fb2-2d7c0c28cd2c.json b/change-beta/@azure-communication-react-424e27fb-3ea9-4505-8fb2-2d7c0c28cd2c.json new file mode 100644 index 00000000000..89cb2416162 --- /dev/null +++ b/change-beta/@azure-communication-react-424e27fb-3ea9-4505-8fb2-2d7c0c28cd2c.json @@ -0,0 +1,9 @@ +{ + "type": "minor", + "area": "feature", + "workstream": "", + "comment": "Support Composites joining existing calls by updating CallAdapter and CallWithChatAdapters to take an existing call as a contruction parameter instead of a locator.", + "packageName": "@azure/communication-react", + "email": "2684369+JamesBurnside@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/change/@azure-communication-react-424e27fb-3ea9-4505-8fb2-2d7c0c28cd2c.json b/change/@azure-communication-react-424e27fb-3ea9-4505-8fb2-2d7c0c28cd2c.json new file mode 100644 index 00000000000..89cb2416162 --- /dev/null +++ b/change/@azure-communication-react-424e27fb-3ea9-4505-8fb2-2d7c0c28cd2c.json @@ -0,0 +1,9 @@ +{ + "type": "minor", + "area": "feature", + "workstream": "", + "comment": "Support Composites joining existing calls by updating CallAdapter and CallWithChatAdapters to take an existing call as a contruction parameter instead of a locator.", + "packageName": "@azure/communication-react", + "email": "2684369+JamesBurnside@users.noreply.github.com", + "dependentChangeType": "patch" +} From 4309ed28a7cc81e0d03e9bd16ab606cb864603aa Mon Sep 17 00:00:00 2001 From: James Burnside <2684369+JamesBurnside@users.noreply.github.com> Date: Thu, 28 Nov 2024 18:11:17 +0000 Subject: [PATCH 4/6] revert any changes to string files caused by prettier --- .../src/localization/locales/ar-SA/strings.json | 2 +- .../src/localization/locales/cs-CZ/strings.json | 2 +- .../src/localization/locales/cy-GB/strings.json | 2 +- .../src/localization/locales/de-DE/strings.json | 2 +- .../src/localization/locales/en-GB/strings.json | 2 +- .../src/localization/locales/es-ES/strings.json | 2 +- .../src/localization/locales/es-MX/strings.json | 2 +- .../src/localization/locales/fi-FI/strings.json | 2 +- .../src/localization/locales/fr-CA/strings.json | 2 +- .../src/localization/locales/fr-FR/strings.json | 2 +- .../src/localization/locales/he-IL/strings.json | 2 +- .../src/localization/locales/it-IT/strings.json | 2 +- .../src/localization/locales/ja-JP/strings.json | 2 +- .../src/localization/locales/ko-KR/strings.json | 2 +- .../src/localization/locales/nb-NO/strings.json | 2 +- .../src/localization/locales/nl-NL/strings.json | 2 +- .../src/localization/locales/pl-PL/strings.json | 2 +- .../src/localization/locales/pt-BR/strings.json | 2 +- .../src/localization/locales/ru-RU/strings.json | 2 +- .../src/localization/locales/sv-SE/strings.json | 2 +- .../src/localization/locales/tr-TR/strings.json | 2 +- .../src/localization/locales/zh-CN/strings.json | 2 +- .../src/localization/locales/zh-TW/strings.json | 2 +- .../src/composites/localization/locales/ar-SA/strings.json | 2 +- .../src/composites/localization/locales/cs-CZ/strings.json | 2 +- .../src/composites/localization/locales/cy-GB/strings.json | 2 +- .../src/composites/localization/locales/de-DE/strings.json | 2 +- .../src/composites/localization/locales/en-GB/strings.json | 2 +- .../src/composites/localization/locales/es-ES/strings.json | 2 +- .../src/composites/localization/locales/es-MX/strings.json | 2 +- .../src/composites/localization/locales/fi-FI/strings.json | 2 +- .../src/composites/localization/locales/fr-CA/strings.json | 2 +- .../src/composites/localization/locales/fr-FR/strings.json | 2 +- .../src/composites/localization/locales/he-IL/strings.json | 2 +- .../src/composites/localization/locales/it-IT/strings.json | 2 +- .../src/composites/localization/locales/ja-JP/strings.json | 2 +- .../src/composites/localization/locales/ko-KR/strings.json | 2 +- .../src/composites/localization/locales/nb-NO/strings.json | 2 +- .../src/composites/localization/locales/nl-NL/strings.json | 2 +- .../src/composites/localization/locales/pl-PL/strings.json | 2 +- .../src/composites/localization/locales/pt-BR/strings.json | 2 +- .../src/composites/localization/locales/ru-RU/strings.json | 2 +- .../src/composites/localization/locales/sv-SE/strings.json | 2 +- .../src/composites/localization/locales/tr-TR/strings.json | 2 +- .../src/composites/localization/locales/zh-CN/strings.json | 2 +- .../src/composites/localization/locales/zh-TW/strings.json | 2 +- 46 files changed, 46 insertions(+), 46 deletions(-) diff --git a/packages/react-components/src/localization/locales/ar-SA/strings.json b/packages/react-components/src/localization/locales/ar-SA/strings.json index 108651d6940..ff3c8849179 100644 --- a/packages/react-components/src/localization/locales/ar-SA/strings.json +++ b/packages/react-components/src/localization/locales/ar-SA/strings.json @@ -689,4 +689,4 @@ "bannerContent": "تم تمكين RTT (نص الوقت الحقيقي) لجميع المشاركين طوال مدة الاجتماع.", "bannerLinkLabel": "تعرّف على المزيد" } -} +} \ No newline at end of file diff --git a/packages/react-components/src/localization/locales/cs-CZ/strings.json b/packages/react-components/src/localization/locales/cs-CZ/strings.json index 023af9c5b67..82746d54572 100644 --- a/packages/react-components/src/localization/locales/cs-CZ/strings.json +++ b/packages/react-components/src/localization/locales/cs-CZ/strings.json @@ -689,4 +689,4 @@ "bannerContent": "RTT (psaní v reálném čase) je povolené pro všechny účastníky po celou dobu trvání schůzky.", "bannerLinkLabel": "Další informace" } -} +} \ No newline at end of file diff --git a/packages/react-components/src/localization/locales/cy-GB/strings.json b/packages/react-components/src/localization/locales/cy-GB/strings.json index d224e02e802..446f8d053d5 100644 --- a/packages/react-components/src/localization/locales/cy-GB/strings.json +++ b/packages/react-components/src/localization/locales/cy-GB/strings.json @@ -689,4 +689,4 @@ "bannerContent": "Mae RTT (testun amser real) wedi'i alluogi ar gyfer yr holl gyfranogwyr ar gyfer cyfnod cyfan y cyfarfod.", "bannerLinkLabel": "Dysgu mwy" } -} +} \ No newline at end of file diff --git a/packages/react-components/src/localization/locales/de-DE/strings.json b/packages/react-components/src/localization/locales/de-DE/strings.json index 9106d14cca8..61c8baa5d25 100644 --- a/packages/react-components/src/localization/locales/de-DE/strings.json +++ b/packages/react-components/src/localization/locales/de-DE/strings.json @@ -689,4 +689,4 @@ "bannerContent": "RTT (Echtzeittext) ist für alle Teilnehmer für die gesamte Dauer der Besprechung aktiviert.", "bannerLinkLabel": "Mehr erfahren" } -} +} \ No newline at end of file diff --git a/packages/react-components/src/localization/locales/en-GB/strings.json b/packages/react-components/src/localization/locales/en-GB/strings.json index 120fd6a6e59..6c6516afb4b 100644 --- a/packages/react-components/src/localization/locales/en-GB/strings.json +++ b/packages/react-components/src/localization/locales/en-GB/strings.json @@ -689,4 +689,4 @@ "bannerContent": "RTT (real-time text) is enabled for all participants for the entire duration of the meeting.", "bannerLinkLabel": "Learn more" } -} +} \ No newline at end of file diff --git a/packages/react-components/src/localization/locales/es-ES/strings.json b/packages/react-components/src/localization/locales/es-ES/strings.json index a4f33b04427..e545c2862e6 100644 --- a/packages/react-components/src/localization/locales/es-ES/strings.json +++ b/packages/react-components/src/localization/locales/es-ES/strings.json @@ -689,4 +689,4 @@ "bannerContent": "RtT (texto en tiempo real) está habilitado para todos los participantes durante toda la reunión.", "bannerLinkLabel": "Más información" } -} +} \ No newline at end of file diff --git a/packages/react-components/src/localization/locales/es-MX/strings.json b/packages/react-components/src/localization/locales/es-MX/strings.json index ef57f086fd8..5ca0c9d8108 100644 --- a/packages/react-components/src/localization/locales/es-MX/strings.json +++ b/packages/react-components/src/localization/locales/es-MX/strings.json @@ -689,4 +689,4 @@ "bannerContent": "RTT (texto en tiempo real) está habilitado para todos los participantes durante toda la reunión.", "bannerLinkLabel": "Más información" } -} +} \ No newline at end of file diff --git a/packages/react-components/src/localization/locales/fi-FI/strings.json b/packages/react-components/src/localization/locales/fi-FI/strings.json index bec9761aab0..df465d3d7e7 100644 --- a/packages/react-components/src/localization/locales/fi-FI/strings.json +++ b/packages/react-components/src/localization/locales/fi-FI/strings.json @@ -689,4 +689,4 @@ "bannerContent": "RTT (reaaliaikainen teksti) on käytössä kaikille osallistujille koko kokouksen keston ajan.", "bannerLinkLabel": "Lue lisää" } -} +} \ No newline at end of file diff --git a/packages/react-components/src/localization/locales/fr-CA/strings.json b/packages/react-components/src/localization/locales/fr-CA/strings.json index 14c46cbfa1f..c42eb487190 100644 --- a/packages/react-components/src/localization/locales/fr-CA/strings.json +++ b/packages/react-components/src/localization/locales/fr-CA/strings.json @@ -689,4 +689,4 @@ "bannerContent": "RTT (texte en temps réel) est activé pour tous les participants pendant toute la durée de la réunion.", "bannerLinkLabel": "En savoir plus" } -} +} \ No newline at end of file diff --git a/packages/react-components/src/localization/locales/fr-FR/strings.json b/packages/react-components/src/localization/locales/fr-FR/strings.json index 3d28abc345a..bc9345c2ef5 100644 --- a/packages/react-components/src/localization/locales/fr-FR/strings.json +++ b/packages/react-components/src/localization/locales/fr-FR/strings.json @@ -689,4 +689,4 @@ "bannerContent": "RTT (texte en temps réel) est activé pour tous les participants pendant toute la durée de la réunion.", "bannerLinkLabel": "En savoir plus" } -} +} \ No newline at end of file diff --git a/packages/react-components/src/localization/locales/he-IL/strings.json b/packages/react-components/src/localization/locales/he-IL/strings.json index b3e709554da..7c6dfa5f6f6 100644 --- a/packages/react-components/src/localization/locales/he-IL/strings.json +++ b/packages/react-components/src/localization/locales/he-IL/strings.json @@ -689,4 +689,4 @@ "bannerContent": "RTT (טקסט בזמן אמת) זמין עבור כל המשתתפים למשך הזמן כולו של הפגישה.", "bannerLinkLabel": "מידע נוסף" } -} +} \ No newline at end of file diff --git a/packages/react-components/src/localization/locales/it-IT/strings.json b/packages/react-components/src/localization/locales/it-IT/strings.json index 5c17b69a852..a42434e5bad 100644 --- a/packages/react-components/src/localization/locales/it-IT/strings.json +++ b/packages/react-components/src/localization/locales/it-IT/strings.json @@ -689,4 +689,4 @@ "bannerContent": "RTT (testo in tempo reale) è abilitato per tutti i partecipanti per l'intera durata della riunione.", "bannerLinkLabel": "Scopri di più" } -} +} \ No newline at end of file diff --git a/packages/react-components/src/localization/locales/ja-JP/strings.json b/packages/react-components/src/localization/locales/ja-JP/strings.json index f7a752421ad..11d2f9dfd9e 100644 --- a/packages/react-components/src/localization/locales/ja-JP/strings.json +++ b/packages/react-components/src/localization/locales/ja-JP/strings.json @@ -689,4 +689,4 @@ "bannerContent": "RTT (リアルタイム テキスト) は、会議の全期間のすべての参加者に対して有効になっています。", "bannerLinkLabel": "詳しく見る" } -} +} \ No newline at end of file diff --git a/packages/react-components/src/localization/locales/ko-KR/strings.json b/packages/react-components/src/localization/locales/ko-KR/strings.json index 3b865370316..d158a066e75 100644 --- a/packages/react-components/src/localization/locales/ko-KR/strings.json +++ b/packages/react-components/src/localization/locales/ko-KR/strings.json @@ -689,4 +689,4 @@ "bannerContent": "전체 모임 기간 동안 모든 참가자에 대해 RTT(실시간 텍스트)를 사용할 수 있습니다.", "bannerLinkLabel": "자세히 알아보기" } -} +} \ No newline at end of file diff --git a/packages/react-components/src/localization/locales/nb-NO/strings.json b/packages/react-components/src/localization/locales/nb-NO/strings.json index a77d122a7dd..4c964b39518 100644 --- a/packages/react-components/src/localization/locales/nb-NO/strings.json +++ b/packages/react-components/src/localization/locales/nb-NO/strings.json @@ -689,4 +689,4 @@ "bannerContent": "RTT (sanntidstekst) er aktivert for alle deltakere hele varigheten for møtet.", "bannerLinkLabel": "Finn ut mer" } -} +} \ No newline at end of file diff --git a/packages/react-components/src/localization/locales/nl-NL/strings.json b/packages/react-components/src/localization/locales/nl-NL/strings.json index 790b69eb05b..dc0edfc39a7 100644 --- a/packages/react-components/src/localization/locales/nl-NL/strings.json +++ b/packages/react-components/src/localization/locales/nl-NL/strings.json @@ -689,4 +689,4 @@ "bannerContent": "RTT (realtime-tekst) is ingeschakeld voor alle deelnemers gedurende de hele duur van de vergadering.", "bannerLinkLabel": "Meer informatie" } -} +} \ No newline at end of file diff --git a/packages/react-components/src/localization/locales/pl-PL/strings.json b/packages/react-components/src/localization/locales/pl-PL/strings.json index d5d88aad707..45b64168162 100644 --- a/packages/react-components/src/localization/locales/pl-PL/strings.json +++ b/packages/react-components/src/localization/locales/pl-PL/strings.json @@ -689,4 +689,4 @@ "bannerContent": "Funkcja RTT (tekst w czasie rzeczywistym) jest włączona dla wszystkich uczestników przez cały czas trwania spotkania.", "bannerLinkLabel": "Dowiedz się więcej" } -} +} \ No newline at end of file diff --git a/packages/react-components/src/localization/locales/pt-BR/strings.json b/packages/react-components/src/localization/locales/pt-BR/strings.json index de06371561a..79776bdc258 100644 --- a/packages/react-components/src/localization/locales/pt-BR/strings.json +++ b/packages/react-components/src/localization/locales/pt-BR/strings.json @@ -689,4 +689,4 @@ "bannerContent": "O RTT (texto em tempo real) está habilitado para todos os participantes durante toda a reunião.", "bannerLinkLabel": "Saiba mais" } -} +} \ No newline at end of file diff --git a/packages/react-components/src/localization/locales/ru-RU/strings.json b/packages/react-components/src/localization/locales/ru-RU/strings.json index 8f5ba378af9..5eca40df2cb 100644 --- a/packages/react-components/src/localization/locales/ru-RU/strings.json +++ b/packages/react-components/src/localization/locales/ru-RU/strings.json @@ -689,4 +689,4 @@ "bannerContent": "Ввод в режиме реального времени включен для всех участников в течение всего собрания.", "bannerLinkLabel": "Подробнее" } -} +} \ No newline at end of file diff --git a/packages/react-components/src/localization/locales/sv-SE/strings.json b/packages/react-components/src/localization/locales/sv-SE/strings.json index 563e69ac386..ded20843054 100644 --- a/packages/react-components/src/localization/locales/sv-SE/strings.json +++ b/packages/react-components/src/localization/locales/sv-SE/strings.json @@ -689,4 +689,4 @@ "bannerContent": "RTT (realtidstext) är aktiverat för alla deltagare under hela mötets varaktighet.", "bannerLinkLabel": "Mer information" } -} +} \ No newline at end of file diff --git a/packages/react-components/src/localization/locales/tr-TR/strings.json b/packages/react-components/src/localization/locales/tr-TR/strings.json index d09f46dca49..096915cee08 100644 --- a/packages/react-components/src/localization/locales/tr-TR/strings.json +++ b/packages/react-components/src/localization/locales/tr-TR/strings.json @@ -689,4 +689,4 @@ "bannerContent": "RTT (gerçek zamanlı metin) toplantı süresi boyunca tüm katılımcılar için etkindir.", "bannerLinkLabel": "Daha fazla bilgi edinin" } -} +} \ No newline at end of file diff --git a/packages/react-components/src/localization/locales/zh-CN/strings.json b/packages/react-components/src/localization/locales/zh-CN/strings.json index e483564f57b..8caf3196954 100644 --- a/packages/react-components/src/localization/locales/zh-CN/strings.json +++ b/packages/react-components/src/localization/locales/zh-CN/strings.json @@ -689,4 +689,4 @@ "bannerContent": "RTT (在会议的整个持续时间内为所有参与者启用实时文本)。", "bannerLinkLabel": "了解详细信息" } -} +} \ No newline at end of file diff --git a/packages/react-components/src/localization/locales/zh-TW/strings.json b/packages/react-components/src/localization/locales/zh-TW/strings.json index ee5290b929f..54167fd96d3 100644 --- a/packages/react-components/src/localization/locales/zh-TW/strings.json +++ b/packages/react-components/src/localization/locales/zh-TW/strings.json @@ -689,4 +689,4 @@ "bannerContent": "已為整個會議期間的所有參與者啟用 RTT (即時文字)。", "bannerLinkLabel": "深入了解" } -} +} \ No newline at end of file diff --git a/packages/react-composites/src/composites/localization/locales/ar-SA/strings.json b/packages/react-composites/src/composites/localization/locales/ar-SA/strings.json index cd9ccc9bab3..43aa2331a12 100644 --- a/packages/react-composites/src/composites/localization/locales/ar-SA/strings.json +++ b/packages/react-composites/src/composites/localization/locales/ar-SA/strings.json @@ -410,4 +410,4 @@ "breakoutRoomChatPaneTitle": "دردشة الغرفة الفرعية", "chatContentSpinnerLabel": "يتم الآن التحميل..." } -} +} \ No newline at end of file diff --git a/packages/react-composites/src/composites/localization/locales/cs-CZ/strings.json b/packages/react-composites/src/composites/localization/locales/cs-CZ/strings.json index 2b36e893c2c..14eeb60e017 100644 --- a/packages/react-composites/src/composites/localization/locales/cs-CZ/strings.json +++ b/packages/react-composites/src/composites/localization/locales/cs-CZ/strings.json @@ -410,4 +410,4 @@ "breakoutRoomChatPaneTitle": "Chat ve skupinové místnosti", "chatContentSpinnerLabel": "Načítání..." } -} +} \ No newline at end of file diff --git a/packages/react-composites/src/composites/localization/locales/cy-GB/strings.json b/packages/react-composites/src/composites/localization/locales/cy-GB/strings.json index a5ed16ff5dc..7ce201fb603 100644 --- a/packages/react-composites/src/composites/localization/locales/cy-GB/strings.json +++ b/packages/react-composites/src/composites/localization/locales/cy-GB/strings.json @@ -410,4 +410,4 @@ "breakoutRoomChatPaneTitle": "Sgwrs y Cyfarfod Ymylol", "chatContentSpinnerLabel": "Wrthi'n llwytho..." } -} +} \ No newline at end of file diff --git a/packages/react-composites/src/composites/localization/locales/de-DE/strings.json b/packages/react-composites/src/composites/localization/locales/de-DE/strings.json index c2da2971011..e6baf9cbcf1 100644 --- a/packages/react-composites/src/composites/localization/locales/de-DE/strings.json +++ b/packages/react-composites/src/composites/localization/locales/de-DE/strings.json @@ -410,4 +410,4 @@ "breakoutRoomChatPaneTitle": "Chat im Gruppenraum", "chatContentSpinnerLabel": "Wird geladen..." } -} +} \ No newline at end of file diff --git a/packages/react-composites/src/composites/localization/locales/en-GB/strings.json b/packages/react-composites/src/composites/localization/locales/en-GB/strings.json index cec31634112..fcb9e900d7f 100644 --- a/packages/react-composites/src/composites/localization/locales/en-GB/strings.json +++ b/packages/react-composites/src/composites/localization/locales/en-GB/strings.json @@ -410,4 +410,4 @@ "breakoutRoomChatPaneTitle": "Breakout Room Chat", "chatContentSpinnerLabel": "Loading..." } -} +} \ No newline at end of file diff --git a/packages/react-composites/src/composites/localization/locales/es-ES/strings.json b/packages/react-composites/src/composites/localization/locales/es-ES/strings.json index f21d3f66efe..c045bb58a3f 100644 --- a/packages/react-composites/src/composites/localization/locales/es-ES/strings.json +++ b/packages/react-composites/src/composites/localization/locales/es-ES/strings.json @@ -410,4 +410,4 @@ "breakoutRoomChatPaneTitle": "Chat de sala para sesión de subgrupo", "chatContentSpinnerLabel": "Cargando..." } -} +} \ No newline at end of file diff --git a/packages/react-composites/src/composites/localization/locales/es-MX/strings.json b/packages/react-composites/src/composites/localization/locales/es-MX/strings.json index 66d25f3e206..af0dc5a1fdf 100644 --- a/packages/react-composites/src/composites/localization/locales/es-MX/strings.json +++ b/packages/react-composites/src/composites/localization/locales/es-MX/strings.json @@ -410,4 +410,4 @@ "breakoutRoomChatPaneTitle": "Breakout Room Chat", "chatContentSpinnerLabel": "Loading..." } -} +} \ No newline at end of file diff --git a/packages/react-composites/src/composites/localization/locales/fi-FI/strings.json b/packages/react-composites/src/composites/localization/locales/fi-FI/strings.json index 83e1e5ce2a2..c015845542b 100644 --- a/packages/react-composites/src/composites/localization/locales/fi-FI/strings.json +++ b/packages/react-composites/src/composites/localization/locales/fi-FI/strings.json @@ -410,4 +410,4 @@ "breakoutRoomChatPaneTitle": "Pienryhmätilan keskustelu", "chatContentSpinnerLabel": "Ladataan..." } -} +} \ No newline at end of file diff --git a/packages/react-composites/src/composites/localization/locales/fr-CA/strings.json b/packages/react-composites/src/composites/localization/locales/fr-CA/strings.json index 66d25f3e206..af0dc5a1fdf 100644 --- a/packages/react-composites/src/composites/localization/locales/fr-CA/strings.json +++ b/packages/react-composites/src/composites/localization/locales/fr-CA/strings.json @@ -410,4 +410,4 @@ "breakoutRoomChatPaneTitle": "Breakout Room Chat", "chatContentSpinnerLabel": "Loading..." } -} +} \ No newline at end of file diff --git a/packages/react-composites/src/composites/localization/locales/fr-FR/strings.json b/packages/react-composites/src/composites/localization/locales/fr-FR/strings.json index b7d78e8b121..d71fcd86770 100644 --- a/packages/react-composites/src/composites/localization/locales/fr-FR/strings.json +++ b/packages/react-composites/src/composites/localization/locales/fr-FR/strings.json @@ -410,4 +410,4 @@ "breakoutRoomChatPaneTitle": "Conversation dans une salle pour petit groupe", "chatContentSpinnerLabel": "Chargement en cours..." } -} +} \ No newline at end of file diff --git a/packages/react-composites/src/composites/localization/locales/he-IL/strings.json b/packages/react-composites/src/composites/localization/locales/he-IL/strings.json index b6d1dbf0d3a..66997a6aa19 100644 --- a/packages/react-composites/src/composites/localization/locales/he-IL/strings.json +++ b/packages/react-composites/src/composites/localization/locales/he-IL/strings.json @@ -410,4 +410,4 @@ "breakoutRoomChatPaneTitle": "צ'אט פיצול חדרים", "chatContentSpinnerLabel": "בטעינה..." } -} +} \ No newline at end of file diff --git a/packages/react-composites/src/composites/localization/locales/it-IT/strings.json b/packages/react-composites/src/composites/localization/locales/it-IT/strings.json index 14130ebea29..86f8f8e5c6b 100644 --- a/packages/react-composites/src/composites/localization/locales/it-IT/strings.json +++ b/packages/react-composites/src/composites/localization/locales/it-IT/strings.json @@ -410,4 +410,4 @@ "breakoutRoomChatPaneTitle": "Chat della stanza di lavoro", "chatContentSpinnerLabel": "Caricamento in corso..." } -} +} \ No newline at end of file diff --git a/packages/react-composites/src/composites/localization/locales/ja-JP/strings.json b/packages/react-composites/src/composites/localization/locales/ja-JP/strings.json index 30dbd8d53e6..c8e310332ca 100644 --- a/packages/react-composites/src/composites/localization/locales/ja-JP/strings.json +++ b/packages/react-composites/src/composites/localization/locales/ja-JP/strings.json @@ -410,4 +410,4 @@ "breakoutRoomChatPaneTitle": "ブレークアウト ルーム チャット", "chatContentSpinnerLabel": "読み込んでいます..." } -} +} \ No newline at end of file diff --git a/packages/react-composites/src/composites/localization/locales/ko-KR/strings.json b/packages/react-composites/src/composites/localization/locales/ko-KR/strings.json index d24ca840e39..854ad15c20e 100644 --- a/packages/react-composites/src/composites/localization/locales/ko-KR/strings.json +++ b/packages/react-composites/src/composites/localization/locales/ko-KR/strings.json @@ -410,4 +410,4 @@ "breakoutRoomChatPaneTitle": "소규모 회의실 채팅", "chatContentSpinnerLabel": "로드하는 중..." } -} +} \ No newline at end of file diff --git a/packages/react-composites/src/composites/localization/locales/nb-NO/strings.json b/packages/react-composites/src/composites/localization/locales/nb-NO/strings.json index c3c68834f20..40fea09ae06 100644 --- a/packages/react-composites/src/composites/localization/locales/nb-NO/strings.json +++ b/packages/react-composites/src/composites/localization/locales/nb-NO/strings.json @@ -410,4 +410,4 @@ "breakoutRoomChatPaneTitle": "Grupperomchat", "chatContentSpinnerLabel": "Laster inn ..." } -} +} \ No newline at end of file diff --git a/packages/react-composites/src/composites/localization/locales/nl-NL/strings.json b/packages/react-composites/src/composites/localization/locales/nl-NL/strings.json index 136b6783315..97424511e9c 100644 --- a/packages/react-composites/src/composites/localization/locales/nl-NL/strings.json +++ b/packages/react-composites/src/composites/localization/locales/nl-NL/strings.json @@ -410,4 +410,4 @@ "breakoutRoomChatPaneTitle": "Aparte vergaderruimte chat", "chatContentSpinnerLabel": "Laden..." } -} +} \ No newline at end of file diff --git a/packages/react-composites/src/composites/localization/locales/pl-PL/strings.json b/packages/react-composites/src/composites/localization/locales/pl-PL/strings.json index 50c52c9a506..f0a667af7b8 100644 --- a/packages/react-composites/src/composites/localization/locales/pl-PL/strings.json +++ b/packages/react-composites/src/composites/localization/locales/pl-PL/strings.json @@ -410,4 +410,4 @@ "breakoutRoomChatPaneTitle": "Czat osobnego pokoju", "chatContentSpinnerLabel": "Trwa ładowanie..." } -} +} \ No newline at end of file diff --git a/packages/react-composites/src/composites/localization/locales/pt-BR/strings.json b/packages/react-composites/src/composites/localization/locales/pt-BR/strings.json index 98e3f4cbb14..e0609ba83ad 100644 --- a/packages/react-composites/src/composites/localization/locales/pt-BR/strings.json +++ b/packages/react-composites/src/composites/localization/locales/pt-BR/strings.json @@ -410,4 +410,4 @@ "breakoutRoomChatPaneTitle": "Chat da Sala para Sessão de Grupo", "chatContentSpinnerLabel": "Carregando..." } -} +} \ No newline at end of file diff --git a/packages/react-composites/src/composites/localization/locales/ru-RU/strings.json b/packages/react-composites/src/composites/localization/locales/ru-RU/strings.json index 7c1f2470f6c..0eb5dab5db8 100644 --- a/packages/react-composites/src/composites/localization/locales/ru-RU/strings.json +++ b/packages/react-composites/src/composites/localization/locales/ru-RU/strings.json @@ -410,4 +410,4 @@ "breakoutRoomChatPaneTitle": "Чат переговорной комнаты", "chatContentSpinnerLabel": "Загрузка…" } -} +} \ No newline at end of file diff --git a/packages/react-composites/src/composites/localization/locales/sv-SE/strings.json b/packages/react-composites/src/composites/localization/locales/sv-SE/strings.json index 285083e6aee..8fa7ee10c3e 100644 --- a/packages/react-composites/src/composites/localization/locales/sv-SE/strings.json +++ b/packages/react-composites/src/composites/localization/locales/sv-SE/strings.json @@ -410,4 +410,4 @@ "breakoutRoomChatPaneTitle": "Grupprumschatt", "chatContentSpinnerLabel": "Läser in ..." } -} +} \ No newline at end of file diff --git a/packages/react-composites/src/composites/localization/locales/tr-TR/strings.json b/packages/react-composites/src/composites/localization/locales/tr-TR/strings.json index 5e91f14009d..5035b522124 100644 --- a/packages/react-composites/src/composites/localization/locales/tr-TR/strings.json +++ b/packages/react-composites/src/composites/localization/locales/tr-TR/strings.json @@ -410,4 +410,4 @@ "breakoutRoomChatPaneTitle": "Tartışma Odası Sohbeti", "chatContentSpinnerLabel": "Yükleniyor..." } -} +} \ No newline at end of file diff --git a/packages/react-composites/src/composites/localization/locales/zh-CN/strings.json b/packages/react-composites/src/composites/localization/locales/zh-CN/strings.json index a4fbdea8d98..ed949dfe676 100644 --- a/packages/react-composites/src/composites/localization/locales/zh-CN/strings.json +++ b/packages/react-composites/src/composites/localization/locales/zh-CN/strings.json @@ -410,4 +410,4 @@ "breakoutRoomChatPaneTitle": "分组讨论室聊天", "chatContentSpinnerLabel": "正在加载..." } -} +} \ No newline at end of file diff --git a/packages/react-composites/src/composites/localization/locales/zh-TW/strings.json b/packages/react-composites/src/composites/localization/locales/zh-TW/strings.json index 0a690efbb11..85d37c406f5 100644 --- a/packages/react-composites/src/composites/localization/locales/zh-TW/strings.json +++ b/packages/react-composites/src/composites/localization/locales/zh-TW/strings.json @@ -410,4 +410,4 @@ "breakoutRoomChatPaneTitle": "分組討論區聊天", "chatContentSpinnerLabel": "正在載入..." } -} +} \ No newline at end of file From 6caa0e476fdd5f8c2acf57bca4229efdf94968e6 Mon Sep 17 00:00:00 2001 From: James Burnside <2684369+JamesBurnside@users.noreply.github.com> Date: Fri, 29 Nov 2024 18:25:39 +0000 Subject: [PATCH 5/6] update to cope with threadid only coming in at connected state --- .../calling-stateful-client/src/TypeGuards.ts | 13 ++++- packages/calling-stateful-client/src/index.ts | 2 +- .../adapter/AzureCommunicationCallAdapter.ts | 58 ++++++++----------- .../composites/CallComposite/utils/Utils.ts | 43 +++++++++++++- 4 files changed, 75 insertions(+), 41 deletions(-) diff --git a/packages/calling-stateful-client/src/TypeGuards.ts b/packages/calling-stateful-client/src/TypeGuards.ts index 5100284bd6f..5962371c293 100644 --- a/packages/calling-stateful-client/src/TypeGuards.ts +++ b/packages/calling-stateful-client/src/TypeGuards.ts @@ -3,6 +3,7 @@ import { Call, CallAgent, TeamsCallAgent, IncomingCallCommon } from '@azure/communication-calling'; import { CallAgentCommon, CallCommon, TeamsCall } from './BetaToStableTypes'; +import { CallState } from './CallClientState'; /** * @internal @@ -47,8 +48,16 @@ export const _isACSIncomingCall = (call: IncomingCallCommon): boolean => { }; /** + * Heuristic to detect if a call is a Teams meeting call. + * `threadId` is only available when the call is connected. + * `InLobby` state is only available for Teams calls currently. + * + * @remarks + * This is a heuristic is not accurate when the call is in the connecting or earlymedia states. + * If ACS group calls or rooms calls support threadId or InLobby state, this heuristic will need to be updated. + * * @internal */ -export const _isTeamsMeeting = (call: CallCommon): boolean => { - return 'info' in call && !!call.info.threadId; +export const _isTeamsMeeting = (call: CallCommon | CallState): boolean => { + return ('info' in call && !!call.info?.threadId) || call.state === 'InLobby'; }; diff --git a/packages/calling-stateful-client/src/index.ts b/packages/calling-stateful-client/src/index.ts index e3d201480ba..6c310af3839 100644 --- a/packages/calling-stateful-client/src/index.ts +++ b/packages/calling-stateful-client/src/index.ts @@ -5,6 +5,6 @@ export * from './index-public'; export { _createStatefulCallClientInner } from './StatefulCallClient'; -export { _isACSCall, _isACSCallAgent, _isTeamsCall, _isTeamsCallAgent } from './TypeGuards'; +export { _isACSCall, _isACSCallAgent, _isTeamsCall, _isTeamsCallAgent, _isTeamsMeeting } from './TypeGuards'; export type { CallAgentCommon, CallCommon, TeamsCall } from './BetaToStableTypes'; diff --git a/packages/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts b/packages/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts index 50d123b8b39..1974d791d63 100644 --- a/packages/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts +++ b/packages/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts @@ -11,8 +11,7 @@ import { StatefulCallClient, StatefulDeviceManager, TeamsCall, - _isACSCall, - _isTeamsCall + _isACSCall } from '@internal/calling-stateful-client'; import { AcceptedTransfer } from '@internal/calling-stateful-client'; import { _isTeamsCallAgent } from '@internal/calling-stateful-client'; @@ -86,7 +85,16 @@ import { VideoBackgroundReplacementEffect } from './CallAdapter'; import { TeamsCallAdapter } from './CallAdapter'; -import { getCallCompositePage, isCall, IsCallEndedPage, isCameraOn, isTargetCallees } from '../utils'; +import { + getCallCompositePage, + isCall, + IsCallEndedPage, + isCameraOn, + isDetectedAsRoomsCall, + isDetectedAsTeamsCallKind, + isDetectedAsTeamsMeeting, + isTargetCallees +} from '../utils'; import { CreateVideoStreamViewResult, VideoStreamOptions } from '@internal/react-components'; import { toFlatCommunicationIdentifier, _toCommunicationIdentifier, _isValidIdentifier } from '@internal/acs-ui-common'; import { @@ -139,13 +147,12 @@ class CallContext { private emitter: EventEmitter = new EventEmitter(); private state: CallContextState; private callId: string | undefined; + private locator: CallAdapterLocator | undefined; private displayNameModifier: AdapterStateModifier | undefined; constructor( clientState: CallClientState, - isTeamsCall: boolean, - isTeamsMeeting: boolean, - isRoomsCall: boolean, + locator: CallAdapterLocator | undefined, options?: { maxListeners?: number; onFetchProfile?: OnFetchProfileCallback; @@ -164,19 +171,20 @@ class CallContext { }, targetCallees?: StartCallIdentifier[] ) { + this.locator = locator; this.state = { isLocalPreviewMicrophoneEnabled: false, userId: clientState.userId, displayName: clientState.callAgent?.displayName, devices: clientState.deviceManager, call: undefined, + isTeamsMeeting: isDetectedAsTeamsMeeting(locator, undefined), + isTeamsCall: isDetectedAsTeamsCallKind(targetCallees, undefined), + isRoomsCall: isDetectedAsRoomsCall(locator, undefined), targetCallees: targetCallees as CommunicationIdentifier[], page: 'configuration', latestErrors: clientState.latestErrors, /* @conditional-compile-remove(breakout-rooms) */ latestNotifications: clientState.latestNotifications, - isTeamsCall, - isTeamsMeeting, - isRoomsCall, alternateCallerId: options?.alternateCallerId, environmentInfo: clientState.environmentInfo, /* @conditional-compile-remove(unsupported-browser) */ unsupportedBrowserVersionsAllowed: false, @@ -269,6 +277,7 @@ class CallContext { environmentInfo: this.state.environmentInfo, unsupportedBrowserVersionOptedIn: this.state.unsupportedBrowserVersionsAllowed }; + const targetCallees = this.state.targetCallees; const latestAcceptedTransfer = call?.transfer.acceptedTransfers ? findLatestAcceptedTransfer(call.transfer.acceptedTransfers) @@ -313,7 +322,10 @@ class CallContext { clientState.deviceManager.unparentedViews.find((s) => s.mediaStreamType === 'Video') ? 'On' : 'Off', - acceptedTransferCallState: transferCall + acceptedTransferCallState: transferCall, + isTeamsMeeting: isDetectedAsTeamsMeeting(this.locator, call), + isTeamsCall: isDetectedAsTeamsCallKind(targetCallees, call), + isRoomsCall: isDetectedAsRoomsCall(this.locator, call) }); } } @@ -447,34 +459,10 @@ export class AzureCommunicationCallAdapter { - if (isMicrosoftTeamsUserIdentifier(callee) || isMicrosoftTeamsAppIdentifier(callee)) { - isTeamsCall = true; - } - }); - - const isOverloadedParamARoomsCallTrampoline = (): boolean => { - /* @conditional-compile-remove(calling-beta-sdk) */ - return !!overloadedParamAsCall?.info.roomId; - return false; - }; - const isRoomsCall = this.locator ? 'roomId' in this.locator : isOverloadedParamARoomsCallTrampoline(); - this.onResolveVideoBackgroundEffectsDependency = options?.videoBackgroundOptions?.onResolveDependency; this.onResolveDeepNoiseSuppressionDependency = options?.deepNoiseSuppressionOptions?.onResolveDependency; - this.context = new CallContext( - callClient.getState(), - !!isTeamsCall, - isTeamsMeeting, - isRoomsCall, - options, - this.targetCallees - ); + this.context = new CallContext(callClient.getState(), this.locator, options, this.targetCallees); this.context.onCallEnded((endCallData) => this.emitter.emit('callEnded', endCallData)); diff --git a/packages/react-composites/src/composites/CallComposite/utils/Utils.ts b/packages/react-composites/src/composites/CallComposite/utils/Utils.ts index 6f434114d16..41e6e2716df 100644 --- a/packages/react-composites/src/composites/CallComposite/utils/Utils.ts +++ b/packages/react-composites/src/composites/CallComposite/utils/Utils.ts @@ -4,14 +4,19 @@ import { CallAdapterState, CallCompositePage, END_CALL_PAGES, StartCallIdentifier } from '../adapter/CallAdapter'; import { _isInCall, _isPreviewOn, _isInLobbyOrConnecting } from '@internal/calling-component-bindings'; import { CallControlOptions } from '../types/CallControlOptions'; -import { CallState, RemoteParticipantState } from '@internal/calling-stateful-client'; -import { isPhoneNumberIdentifier } from '@azure/communication-common'; +import { CallState, RemoteParticipantState, _isTeamsMeeting } from '@internal/calling-stateful-client'; +import { + CommunicationIdentifier, + isMicrosoftTeamsAppIdentifier, + isMicrosoftTeamsUserIdentifier, + isPhoneNumberIdentifier +} from '@azure/communication-common'; import { AdapterStateModifier, CallAdapterLocator } from '../adapter/AzureCommunicationCallAdapter'; import { VideoBackgroundEffectsDependency } from '@internal/calling-component-bindings'; import { VideoBackgroundEffect } from '../adapter/CallAdapter'; -import { EnvironmentInfo, VideoDeviceInfo } from '@azure/communication-calling'; +import { CallCommon, EnvironmentInfo, VideoDeviceInfo } from '@azure/communication-calling'; import { Call, VideoEffectProcessor } from '@azure/communication-calling'; import { CompositeLocale } from '../../localization'; @@ -253,6 +258,38 @@ export const getEndedCallPageProps = ( return { title, moreDetails, disableStartCallButton, iconName }; }; +/** @private */ +export const isDetectedAsTeamsMeeting = ( + locator: CallAdapterLocator | undefined, + call: CallState | undefined +): boolean => { + const locatorIsTeamsMeeting = locator && ('meetingLink' in locator || 'meetingId' in locator); + const callIsTeamsMeeting = call && _isTeamsMeeting(call); + return !!locatorIsTeamsMeeting || !!callIsTeamsMeeting; +}; + +/** @private */ +export const isDetectedAsRoomsCall = ( + locator: CallAdapterLocator | undefined, + call: CallState | undefined +): boolean => { + return !!(locator && 'roomId' in locator) || !!(call?.info && 'roomId' in call.info); +}; + +/** @private */ +export const isDetectedAsTeamsCallKind = ( + targetCallees: CommunicationIdentifier[] | undefined, + call?: CallState | undefined +): boolean => { + let isTeamsCall: boolean = call?.kind === 'TeamsCall'; + targetCallees?.forEach((callee) => { + if (isMicrosoftTeamsUserIdentifier(callee) || isMicrosoftTeamsAppIdentifier(callee)) { + isTeamsCall = true; + } + }); + return isTeamsCall; +}; + /** * type definition for conditional-compilation */ From 6f487d19f5364c864bbdaf7791ec9503e19872ba Mon Sep 17 00:00:00 2001 From: James Burnside <2684369+JamesBurnside@users.noreply.github.com> Date: Fri, 29 Nov 2024 22:10:57 +0000 Subject: [PATCH 6/6] remove unused imports --- .../CallComposite/adapter/AzureCommunicationCallAdapter.ts | 3 +-- .../src/composites/CallComposite/utils/Utils.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts b/packages/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts index 1974d791d63..ea96332557b 100644 --- a/packages/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts +++ b/packages/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts @@ -104,8 +104,7 @@ import { MicrosoftTeamsUserIdentifier, isMicrosoftTeamsUserIdentifier, MicrosoftTeamsAppIdentifier, - UnknownIdentifier, - isMicrosoftTeamsAppIdentifier + UnknownIdentifier } from '@azure/communication-common'; import { isCommunicationUserIdentifier } from '@azure/communication-common'; import { isPhoneNumberIdentifier, PhoneNumberIdentifier } from '@azure/communication-common'; diff --git a/packages/react-composites/src/composites/CallComposite/utils/Utils.ts b/packages/react-composites/src/composites/CallComposite/utils/Utils.ts index 41e6e2716df..cdef15e3e8e 100644 --- a/packages/react-composites/src/composites/CallComposite/utils/Utils.ts +++ b/packages/react-composites/src/composites/CallComposite/utils/Utils.ts @@ -16,7 +16,7 @@ import { AdapterStateModifier, CallAdapterLocator } from '../adapter/AzureCommun import { VideoBackgroundEffectsDependency } from '@internal/calling-component-bindings'; import { VideoBackgroundEffect } from '../adapter/CallAdapter'; -import { CallCommon, EnvironmentInfo, VideoDeviceInfo } from '@azure/communication-calling'; +import { EnvironmentInfo, VideoDeviceInfo } from '@azure/communication-calling'; import { Call, VideoEffectProcessor } from '@azure/communication-calling'; import { CompositeLocale } from '../../localization';