From 1e002f5455d23793bc8ab30f0850543bf8145fa6 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Wed, 19 Apr 2023 08:49:57 +0200 Subject: [PATCH] neon: Display account on notification if multiple accounts are present --- packages/neon/neon/lib/src/utils/push_utils.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/neon/neon/lib/src/utils/push_utils.dart b/packages/neon/neon/lib/src/utils/push_utils.dart index d737896a..9797efbd 100644 --- a/packages/neon/neon/lib/src/utils/push_utils.dart +++ b/packages/neon/neon/lib/src/utils/push_utils.dart @@ -77,8 +77,11 @@ class PushUtils { await cache.init(); NextcloudNotificationsNotification? notification; + var accounts = []; + Account? account; try { - final account = loadAccounts(AppStorage('accounts', sharedPreferences)).find(instance); + accounts = loadAccounts(AppStorage('accounts', sharedPreferences)); + account = accounts.find(instance); if (account != null) { notification = (await account.client.notifications.getNotification(id: pushNotification.subject.nid!)).ocs.data; @@ -105,6 +108,7 @@ class PushUtils { android: AndroidNotificationDetails( appID, appName, + subText: accounts.length > 1 && account != null ? account.client.humanReadableID : null, groupKey: 'app_$appID', icon: '@mipmap/ic_launcher', color: themePrimaryColor,