Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add legacy call invite state events and notifications #2552

Conversation

jmartinesp
Copy link
Member

@jmartinesp jmartinesp commented Mar 14, 2024

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

  • Add a legacy call invite state event to the timeline.
  • Display a notification when a legacy call invite is received.

Motivation and context

Closes #2485

Screenshots / GIFs

In the PR (most of them are accidental renames thanks to Showkase...).

Tests

  • From another client, start a legacy (jitsi) call in a DM.
  • Check the notifications arrives and is displayed in EXA.
  • Open the notification, check the a state event-like timeline item is displayed for it.

Tested devices

  • Physical
  • Emulator
  • OS version(s): 14

Checklist

@jmartinesp jmartinesp requested a review from a team as a code owner March 14, 2024 14:37
@jmartinesp jmartinesp requested review from bmarty and removed request for a team March 14, 2024 14:37
Copy link
Contributor

github-actions bot commented Mar 14, 2024

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/pcZMit

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this work. I believe the body parameter may be removed, and it will fix all my remark at once. Let me know if I am wrong!

import io.element.android.libraries.matrix.api.timeline.item.event.EventType

data class TimelineItemLegacyCallInviteContent(
val body: String,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove this field, since at the end we setting the value to stringProvider.getString(CommonStrings.common_call_invite). Or is it for future usage?

Copy link
Member Author

@jmartinesp jmartinesp Mar 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, but having the field here avoids having to retrieve the strings in a couple of other places. I can move it to those other places since it's true it doesn't add much value and can be a source of future issues.

@@ -63,6 +64,7 @@ class MessageSummaryFormatterImpl @Inject constructor(
is TimelineItemVideoContent -> context.getString(CommonStrings.common_video)
is TimelineItemFileContent -> context.getString(CommonStrings.common_file)
is TimelineItemAudioContent -> context.getString(CommonStrings.common_audio)
is TimelineItemLegacyCallInviteContent -> event.content.body
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use context.getString(CommonStrings.common_call_invite) here

@PreviewsDayNight
@Composable
internal fun TimelineItemLegacyCallInviteViewPreview() = ElementPreview {
TimelineItemLegacyCallInviteView(content = TimelineItemLegacyCallInviteContent(stringResource(CommonStrings.common_call_invite)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also weird to give i18n string in preview object.

import io.element.android.services.toolbox.api.strings.StringProvider
import javax.inject.Inject

class TimelineItemContentLegacyCallInviteFactory @Inject constructor(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be removed as well I guess.

Copy link

codecov bot commented Mar 14, 2024

Codecov Report

Attention: Patch coverage is 62.50000% with 27 lines in your changes are missing coverage. Please review.

❗ No coverage uploaded for pull request base (develop@179579d). Click here to learn what that means.
Report is 1 commits behind head on develop.

❗ Current head 2ea9d9c differs from pull request most recent head 9a43928. Consider uploading reports for the commit 9a43928 to get more accurate results

Files Patch % Lines
...es/messages/impl/actionlist/ActionListPresenter.kt 0.00% 3 Missing and 1 partial ⚠️
...e/components/event/TimelineItemEventContentView.kt 0.00% 2 Missing and 1 partial ⚠️
...eatures/messages/impl/actionlist/ActionListView.kt 0.00% 1 Missing and 1 partial ⚠️
...mponents/event/TimelineItemLegacyCallInviteView.kt 86.66% 0 Missing and 2 partials ⚠️
...vent/TimelineItemContentLegacyCallInviteFactory.kt 50.00% 2 Missing ⚠️
...entformatter/impl/DefaultTimelineEventFormatter.kt 0.00% 2 Missing ⚠️
...push/impl/notifications/RoomGroupMessageCreator.kt 71.42% 0 Missing and 2 partials ⚠️
...ndroid/features/messages/impl/MessagesPresenter.kt 0.00% 0 Missing and 1 partial ⚠️
...ssages/impl/timeline/components/TimelineItemRow.kt 0.00% 0 Missing and 1 partial ⚠️
...line/factories/event/TimelineItemContentFactory.kt 66.66% 1 Missing ⚠️
... and 7 more
Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #2552   +/-   ##
==========================================
  Coverage           ?   73.17%           
==========================================
  Files              ?     1408           
  Lines              ?    34068           
  Branches           ?     6608           
==========================================
  Hits               ?    24929           
  Misses             ?     5689           
  Partials           ?     3450           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jmartinesp jmartinesp added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Mar 14, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Mar 14, 2024
Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fast update!

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@jmartinesp jmartinesp merged commit 67d7905 into develop Mar 14, 2024
16 of 17 checks passed
@jmartinesp jmartinesp deleted the feature/jme/2485-add-legacy-call-state-events-and-notifications branch March 14, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1:1 VoIP calls are silently discarded
2 participants