-
Notifications
You must be signed in to change notification settings - Fork 187
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
Add legacy call invite state events and notifications #2552
Conversation
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
There was a problem hiding this 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, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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))) |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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.
There was a problem hiding this 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!
|
Type of change
Content
Motivation and context
Closes #2485
Screenshots / GIFs
In the PR (most of them are accidental renames thanks to Showkase...).
Tests
Tested devices
Checklist