Skip to content

Add intent system to widget url creation #5200

@toger5

Description

@toger5

Requires: matrix-org/matrix-rust-sdk#5560

In the context of improving element call integration we are simplifying the configuration of element call on EX.
Instead of providing a list of configuration and properties we just need properties now and will add the configurtion based on defaults that are declared in EC and are defined via the intend paramerter.

On EX this means explicitly:

This block (examples are based on the swift codebase.):

.init(
  elementCallUrl: baseURL.absoluteString,
  widgetId: widgetID,
  parentUrl: nil,
  hideHeader: nil,
  preload: nil,
  fontScale: nil,
  appPrompt: false,
  confineToRoom: true,
  font: nil,
  encryption: useEncryption ? .perParticipantKeys : .unencrypted,
  intent: .startCall,
  hideScreensharing: false,
  posthogUserId: nil,
  posthogApiHost: analyticsConfiguration?.posthogAPIHost,
  posthogApiKey: analyticsConfiguration?.posthogAPIKey,
  rageshakeSubmitUrl: rageshakeURL,
  sentryDsn: analyticsConfiguration?.sentryDSN,
  sentryEnvironment: nil,
  controlledMediaDevices: !ProcessInfo.processInfo.isiOSAppOnMac)
)

needs to change to:

.init(
  // init the url paramerts with the full set of values
  elementCallUrl: baseURL.absoluteString,
  widgetId: widgetID,
  parentUrl: nil,
  fontScale: nil,
  font: nil,
  posthogUserId: nil,
  posthogApiHost: analyticsConfiguration?.posthogAPIHost,
  posthogApiKey: analyticsConfiguration?.posthogAPIKey,
  rageshakeSubmitUrl: rageshakeURL,
  sentryDsn: analyticsConfiguration?.sentryDSN,
  sentryEnvironment: nil,
),
.init(
  // init the set of configuration properties by only providing the intent and leaving everything else to the default value (all other fields are `Option<sth>` and can be skipped via `nil`
  intent: .startCall // There are 4 intends join/start and dm/non-dm the correct intent needs to be computed and added here
  // use default of init object. Not sure if that is available all other fields just need to be set to nil.
)

PS.
The example code here is based on the swift codebase. I do hope that + the auto complete form the ffi generated code is enought to make sense out of it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-TaskRefactoring, enabling or disabling functionality, other engineering tasks

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions