pub(crate) fn is_shared_with(&self, user_id: &UserId, device_id: &DeviceId) -> bool {
        let shared_with = self
            .shared_with_set
            .get(user_id)
            .map(|d| d.contains(device_id))
            .unwrap_or(false);

        let should_be_shared_with = if self.shared() {
            false
        } else {
            let device_id = DeviceIdOrAllDevices::DeviceId(device_id.into());

            self.to_share_with_set.iter().any(|item| {
                if let Some(e) = item.value().messages.get(user_id) {
                    e.contains_key(&device_id)
                } else {
                    false
                }
            })
        };

        shared_with || should_be_shared_with
    }
/// Has or will the session be shared with the given user/device pair.
Has or will the session be shared with the given user/device pair.
Has or will the session be shared with the given user / device pair .
pub(crate) fn is_shared_with(&self, user_id: &UserId, device_id: &DeviceId) -> bool {
        let shared_with = self
            .shared_with_set
            .get(user_id)
            .map(|d| d.contains(device_id))
            .unwrap_or(false);
        let should_be_shared_with = if self.shared() {
            false
        } else {
            let device_id = DeviceIdOrAllDevices::DeviceId(device_id.into());
            self.to_share_with_set.iter().any(|item| {
                if let Some(e) = item.value().messages.get(user_id) {
                    e.contains_key(&device_id)
                } else {
                    false
                }
            })
        };
        shared_with || should_be_shared_with
    }
pub ( crate ) fn is_shared_with ( & self , user_id : & UserId , device_id : & DeviceId ) -> bool { let shared_with = self . shared_with_set . get ( user_id ) . map ( | d | d . contains ( device_id ) ) . unwrap_or ( false ) ; let should_be_shared_with = if self . shared ( ) { false } else { let device_id = DeviceIdOrAllDevices :: DeviceId ( device_id . into ( ) ) ; self . to_share_with_set . iter ( ) . any ( | item | { if let Some ( e ) = item . value ( ) . messages . get ( user_id ) { e . contains_key ( & device_id ) } else { false } } ) } ; shared_with || should_be_shared_with }
Has or will the session be shared with the given user/device pair.
Has or will the session be shared with the given user / device pair .
&self
user_id
&UserId
device_id
&DeviceId
&self
user_id
&UserId
device_id
&DeviceId