documenting the getEmails function and lifting it out of the class as it's not directly tied to the class
This commit is contained in:
parent
8316728e53
commit
efec63e979
|
@ -155,13 +155,6 @@ class VectorSettingsNotificationPreferenceFragment @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
private fun Session.getEmailsWithPushInformation(): List<Pair<ThreePid.Email, Pusher?>> {
|
||||
val emailPushers = getPushers().filter { it.kind == "email" }
|
||||
return getThreePids()
|
||||
.filterIsInstance<ThreePid.Email>()
|
||||
.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<Pair<ThreePid.Email, Pusher?>> {
|
||||
val emailPushers = getPushers().filter { it.kind == "email" }
|
||||
return getThreePids()
|
||||
.filterIsInstance<ThreePid.Email>()
|
||||
.map { it to emailPushers.firstOrNull { pusher -> pusher.pushKey == it.email } }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue