Improve the notification setting description

The current text has invited a lot of confusion around how notifications
work in NeoChat, because it mentions "push notifications". Some users
take it to mean that somehow the notifications appear in the background,
but that's only supported if built with KUnifiedPush.

To make it super clear, let's change the description dynamically based
on whether:
1. NeoChat is built with KUnifiedPush support.
2. We were able to connect with the KUnifiedPush daemon and your server
has a push gateway.
This commit is contained in:
Joshua Goins
2025-02-22 10:33:52 -05:00
parent 4725410c0f
commit e060032e6a
3 changed files with 43 additions and 1 deletions

View File

@@ -26,7 +26,17 @@ FormCard.FormCardPage {
Layout.topMargin: Kirigami.Units.largeSpacing * 4
FormCard.FormCheckDelegate {
text: i18n("Enable notifications for this account")
description: i18n("Whether push notifications are generated by your Matrix server")
description: {
if (connection.pushNotificationsAvailable) {
if (connection.enablePushNotifications) {
return i18n("Notifications can appear even when NeoChat isn't running.");
} else {
return i18n("Push notifications are available but could not be enabled.");
}
} else {
return i18n("Notifications will only appear when NeoChat is running.");
}
}
checked: root.pushRuleModel.globalNotificationsEnabled
enabled: root.pushRuleModel.globalNotificationsSet
onToggled: {