mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-18 21:52:30 -04:00
chore(base): Move the Room::MAX_ENCRYPTED_EVENTS constant in latest_event.
This patch moves the declaration of the `Room::MAX_ENCRYPTED_TESTS` constants in the `latest_event` module.
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
#[cfg(feature = "e2e-encryption")]
|
||||
use std::collections::BTreeMap;
|
||||
use std::{collections::BTreeMap, num::NonZeroUsize};
|
||||
|
||||
use super::Room;
|
||||
#[cfg(feature = "e2e-encryption")]
|
||||
@@ -24,6 +24,10 @@ use crate::latest_event::LatestEvent;
|
||||
use ruma::{events::AnySyncTimelineEvent, serde::Raw, OwnedRoomId};
|
||||
|
||||
impl Room {
|
||||
/// The size of the latest_encrypted_events RingBuffer
|
||||
#[cfg(feature = "e2e-encryption")]
|
||||
pub(super) const MAX_ENCRYPTED_EVENTS: NonZeroUsize = NonZeroUsize::new(10).unwrap();
|
||||
|
||||
/// Return the last event in this room, if one has been cached during
|
||||
/// sliding sync.
|
||||
pub fn latest_event(&self) -> Option<LatestEvent> {
|
||||
|
||||
@@ -115,10 +115,6 @@ pub struct Room {
|
||||
}
|
||||
|
||||
impl Room {
|
||||
/// The size of the latest_encrypted_events RingBuffer
|
||||
#[cfg(feature = "e2e-encryption")]
|
||||
const MAX_ENCRYPTED_EVENTS: std::num::NonZeroUsize = std::num::NonZeroUsize::new(10).unwrap();
|
||||
|
||||
pub(crate) fn new(
|
||||
own_user_id: &UserId,
|
||||
store: Arc<DynStateStore>,
|
||||
|
||||
Reference in New Issue
Block a user