diff --git a/vector/src/main/java/im/vector/app/features/settings/notifications/VectorSettingsNotificationPreferenceFragment.kt b/vector/src/main/java/im/vector/app/features/settings/notifications/VectorSettingsNotificationPreferenceFragment.kt index e13f68eb3a..fb30fae7e4 100644 --- a/vector/src/main/java/im/vector/app/features/settings/notifications/VectorSettingsNotificationPreferenceFragment.kt +++ b/vector/src/main/java/im/vector/app/features/settings/notifications/VectorSettingsNotificationPreferenceFragment.kt @@ -155,13 +155,6 @@ class VectorSettingsNotificationPreferenceFragment @Inject constructor( } } - private fun Session.getEmailsWithPushInformation(): List> { - val emailPushers = getPushers().filter { it.kind == "email" } - return getThreePids() - .filterIsInstance() - .map { it to emailPushers.firstOrNull { pusher -> pusher.pushKey == it.email } } - } - private val batteryStartForActivityResult = registerStartForActivityResult { // Noop } @@ -400,3 +393,17 @@ private fun SwitchPreference.setTransactionalSwitchChangeListener(scope: Corouti true } } + +/** + * Fetches the current users 3pid emails and pairs them with pushers with same email as the push key. + * If no pusher is available for a given emails we can infer that push is not registered for the email. + * @return a list of ThreePid emails paired with its associated Pusher or null. + * @see ThreePid.Email + * @see Pusher + */ +private fun Session.getEmailsWithPushInformation(): List> { + val emailPushers = getPushers().filter { it.kind == "email" } + return getThreePids() + .filterIsInstance() + .map { it to emailPushers.firstOrNull { pusher -> pusher.pushKey == it.email } } +}