Skip to content

[Push] Display FCM instead of DAVx⁵ in distributor settings #1468

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

Conversation

ArnyminerZ
Copy link
Member

@ArnyminerZ ArnyminerZ commented May 14, 2025

Purpose

See #1466

Short description

When the app's package name is detected, it displays FCM instead of DAVx⁵.

image

Checklist

  • The PR has a proper title, description and label.
  • I have self-reviewed the PR.
  • I have added documentation to complex functions and functions that can be used by other modules.
  • I have added reasonable tests or consciously decided to not add tests.

Signed-off-by: Arnau Mora <arnyminerz@proton.me>
@ArnyminerZ ArnyminerZ self-assigned this May 14, 2025
@ArnyminerZ ArnyminerZ added the bug Something isn't working label May 14, 2025
@ArnyminerZ ArnyminerZ marked this pull request as ready for review May 14, 2025 13:35
@ArnyminerZ ArnyminerZ requested review from Copilot and sunkup May 14, 2025 13:35
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the distributor settings UI to show "FCM" instead of "DAVx⁵" when the app’s own package is selected as the push distributor.

  • Introduces a LocalContext check to detect the app’s package name.
  • Conditionally displays a custom string resource for FCM or falls back to the existing distributor lookup.
Comments suppressed due to low confidence (2)

app/src/main/kotlin/at/bitfire/davdroid/ui/AppSettingsScreen.kt:746

  • [nitpick] The variable name context is very generic; consider renaming it to localContext to clarify that it comes from Compose's LocalContext.
val context = LocalContext.current

app/src/main/kotlin/at/bitfire/davdroid/ui/AppSettingsScreen.kt:747

  • There’s no test covering the new branch where the distributor equals the app’s package name; consider adding a unit or UI test to verify this FCM fallback.
val pushAppName = if (pushDistributor == context.packageName) {

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ArnyminerZ ArnyminerZ requested a review from sunkup May 16, 2025 09:51
@rfc2822 rfc2822 merged commit dec5be5 into main-ose May 19, 2025
8 checks passed
@rfc2822 rfc2822 deleted the 1466-push-davx5-settings-dialog-for-push-distributor-shows-davx5-even-if-google-fcm-is-selected branch May 19, 2025 08:49
@rfc2822 rfc2822 changed the title Display FCM instead of DAVx⁵ in distributor settings [Push] Display FCM instead of DAVx⁵ in distributor settings May 22, 2025
@rfc2822 rfc2822 added the push related to WebDAV-Push label May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working push related to WebDAV-Push
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Push] DAVx5 settings dialog for push distributor shows "DAVx5" even if Google FCM is selected
3 participants