core: reuse mergedPreferences/fullGroupPreferences for determining prohibited features and creating chat items instead of re-calculating (#1417)

This commit is contained in:
JRoberts
2022-11-25 15:16:55 +04:00
committed by GitHub
parent e18bb74bfd
commit eb099c526a
2 changed files with 19 additions and 21 deletions
+4 -3
View File
@@ -552,9 +552,10 @@ prefEnabledToText = \case
PrefEnabled {forUser = True, forContact = False} -> "enabled for you"
PrefEnabled {forUser = False, forContact = True} -> "enabled for contact"
contactUserPreferences' :: User -> Contact -> ContactUserPreferences
contactUserPreferences' user ct =
contactUserPreferences user (userPreferences ct) (preferences' ct) (contactConnIncognito ct)
updateMergedPreferences :: User -> Contact -> Contact
updateMergedPreferences user ct =
let mergedPreferences = contactUserPreferences user (userPreferences ct) (preferences' ct) (contactConnIncognito ct)
in ct {mergedPreferences}
contactUserPreferences :: User -> Preferences -> Maybe Preferences -> Bool -> ContactUserPreferences
contactUserPreferences user userPreferences contactPreferences connectedIncognito =