diff --git a/src/service/appservice/mod.rs b/src/service/appservice/mod.rs index 3f2241c6..1e6b1f7f 100644 --- a/src/service/appservice/mod.rs +++ b/src/service/appservice/mod.rs @@ -206,6 +206,9 @@ impl Service { } /// Checks if a given room id matches any exclusive appservice regex + /// + /// TODO: use this? + #[allow(dead_code)] pub(crate) async fn is_exclusive_room_id(&self, room_id: &RoomId) -> bool { self.read() .await diff --git a/src/service/globals/data.rs b/src/service/globals/data.rs index c44500ab..1d75867c 100644 --- a/src/service/globals/data.rs +++ b/src/service/globals/data.rs @@ -18,9 +18,15 @@ pub(crate) trait Data: Send + Sync { #[allow(unused_qualifications)] // async traits async fn watch(&self, user_id: &UserId, device_id: &DeviceId) -> Result<()>; fn cleanup(&self) -> Result<()>; + + /// TODO: use this? + #[allow(dead_code)] fn flush(&self) -> Result<()>; fn cork(&self) -> Result; fn cork_and_flush(&self) -> Result; + + /// TODO: use this? + #[allow(dead_code)] fn cork_and_sync(&self) -> Result; fn memory_usage(&self) -> String; fn clear_caches(&self, amount: u32); diff --git a/src/service/globals/mod.rs b/src/service/globals/mod.rs index dfdb40af..a28d2221 100644 --- a/src/service/globals/mod.rs +++ b/src/service/globals/mod.rs @@ -207,6 +207,8 @@ impl Service<'_> { pub(crate) fn cleanup(&self) -> Result<()> { self.db.cleanup() } + /// TODO: use this? + #[allow(dead_code)] pub(crate) fn flush(&self) -> Result<()> { self.db.flush() } pub(crate) fn server_name(&self) -> &ServerName { self.config.server_name.as_ref() } @@ -231,10 +233,6 @@ impl Service<'_> { self.config.allow_public_room_directory_over_federation } - pub(crate) fn allow_public_room_directory_without_auth(&self) -> bool { - self.config.allow_public_room_directory_without_auth - } - pub(crate) fn allow_device_name_federation(&self) -> bool { self.config.allow_device_name_federation } pub(crate) fn allow_room_creation(&self) -> bool { self.config.allow_room_creation } @@ -253,8 +251,6 @@ impl Service<'_> { pub(crate) fn dns_resolver(&self) -> &TokioAsyncResolver { &self.resolver.resolver } - pub(crate) fn query_all_nameservers(&self) -> bool { self.config.query_all_nameservers } - pub(crate) fn actual_destinations(&self) -> &Arc> { &self.resolver.destinations } pub(crate) fn jwt_decoding_key(&self) -> Option<&jsonwebtoken::DecodingKey> { self.jwt_decoding_key.as_ref() } @@ -269,8 +265,6 @@ impl Service<'_> { pub(crate) fn turn_secret(&self) -> &String { &self.config.turn_secret } - pub(crate) fn auto_join_rooms(&self) -> &[OwnedRoomId] { &self.config.auto_join_rooms } - pub(crate) fn allow_profile_lookup_federation_requests(&self) -> bool { self.config.allow_profile_lookup_federation_requests } @@ -309,46 +303,18 @@ impl Service<'_> { pub(crate) fn allow_outgoing_presence(&self) -> bool { self.config.allow_outgoing_presence } - pub(crate) fn presence_idle_timeout_s(&self) -> u64 { self.config.presence_idle_timeout_s } - - pub(crate) fn presence_offline_timeout_s(&self) -> u64 { self.config.presence_offline_timeout_s } - pub(crate) fn allow_incoming_read_receipts(&self) -> bool { self.config.allow_incoming_read_receipts } pub(crate) fn allow_outgoing_read_receipts(&self) -> bool { self.config.allow_outgoing_read_receipts } - pub(crate) fn rocksdb_log_level(&self) -> &String { &self.config.rocksdb_log_level } - - pub(crate) fn rocksdb_max_log_file_size(&self) -> usize { self.config.rocksdb_max_log_file_size } - - pub(crate) fn rocksdb_log_time_to_roll(&self) -> usize { self.config.rocksdb_log_time_to_roll } - - pub(crate) fn rocksdb_optimize_for_spinning_disks(&self) -> bool { self.config.rocksdb_optimize_for_spinning_disks } - - pub(crate) fn rocksdb_parallelism_threads(&self) -> usize { self.config.rocksdb_parallelism_threads } - - pub(crate) fn rocksdb_compression_algo(&self) -> &String { &self.config.rocksdb_compression_algo } - - pub(crate) fn rocksdb_compression_level(&self) -> i32 { self.config.rocksdb_compression_level } - - pub(crate) fn rocksdb_bottommost_compression_level(&self) -> i32 { - self.config.rocksdb_bottommost_compression_level - } - pub(crate) fn prevent_media_downloads_from(&self) -> &[OwnedServerName] { &self.config.prevent_media_downloads_from } - pub(crate) fn forbidden_remote_server_names(&self) -> &[OwnedServerName] { - &self.config.forbidden_remote_server_names - } - pub(crate) fn forbidden_remote_room_directory_server_names(&self) -> &[OwnedServerName] { &self.config.forbidden_remote_room_directory_server_names } - pub(crate) fn ip_range_denylist(&self) -> &[String] { &self.config.ip_range_denylist } - pub(crate) fn well_known_support_page(&self) -> &Option { &self.config.well_known.support_page } pub(crate) fn well_known_support_role(&self) -> &Option { &self.config.well_known.support_role } diff --git a/src/service/media/data.rs b/src/service/media/data.rs index 2d15bea1..7a1710b6 100644 --- a/src/service/media/data.rs +++ b/src/service/media/data.rs @@ -17,6 +17,8 @@ pub(crate) trait Data: Send + Sync { fn get_all_media_keys(&self) -> Result>>; + // TODO: use this + #[allow(dead_code)] fn remove_url_preview(&self, url: &str) -> Result<()>; fn set_url_preview(&self, url: &str, data: &super::UrlPreviewData, timestamp: std::time::Duration) -> Result<()>; diff --git a/src/service/media/mod.rs b/src/service/media/mod.rs index 9e83e3c4..2622c5ca 100644 --- a/src/service/media/mod.rs +++ b/src/service/media/mod.rs @@ -459,6 +459,8 @@ impl Service { pub(crate) async fn get_url_preview(&self, url: &str) -> Option { self.db.get_url_preview(url) } + /// TODO: use this? + #[allow(dead_code)] pub(crate) async fn remove_url_preview(&self, url: &str) -> Result<()> { // TODO: also remove the downloaded image self.db.remove_url_preview(url) diff --git a/src/service/rooms/outlier/mod.rs b/src/service/rooms/outlier/mod.rs index 9865b4d8..0de6d366 100644 --- a/src/service/rooms/outlier/mod.rs +++ b/src/service/rooms/outlier/mod.rs @@ -16,6 +16,9 @@ impl Service { } /// Returns the pdu from the outlier tree. + /// + /// TODO: use this? + #[allow(dead_code)] pub(crate) fn get_pdu_outlier(&self, event_id: &EventId) -> Result> { self.db.get_outlier_pdu(event_id) } diff --git a/src/service/rooms/read_receipt/data.rs b/src/service/rooms/read_receipt/data.rs index 410067d5..006b5df8 100644 --- a/src/service/rooms/read_receipt/data.rs +++ b/src/service/rooms/read_receipt/data.rs @@ -21,8 +21,14 @@ pub(crate) trait Data: Send + Sync { fn private_read_set(&self, room_id: &RoomId, user_id: &UserId, count: u64) -> Result<()>; /// Returns the private read marker. + /// + /// TODO: use this? + #[allow(dead_code)] fn private_read_get(&self, room_id: &RoomId, user_id: &UserId) -> Result>; /// Returns the count of the last typing update in this room. + /// + /// TODO: use this? + #[allow(dead_code)] fn last_privateread_update(&self, user_id: &UserId, room_id: &RoomId) -> Result; } diff --git a/src/service/rooms/state_cache/data.rs b/src/service/rooms/state_cache/data.rs index 04a5753b..828d4284 100644 --- a/src/service/rooms/state_cache/data.rs +++ b/src/service/rooms/state_cache/data.rs @@ -47,6 +47,9 @@ pub(crate) trait Data: Send + Sync { fn room_invited_count(&self, room_id: &RoomId) -> Result>; /// Returns an iterator over all User IDs who ever joined a room. + /// + /// TODO: use this? + #[allow(dead_code)] fn room_useroncejoined<'a>(&'a self, room_id: &RoomId) -> Box> + 'a>; /// Returns an iterator over all invited members of a room. @@ -83,5 +86,8 @@ pub(crate) trait Data: Send + Sync { /// Add the given servers the list to accept or decline invites via for a /// given room. + /// + /// TODO: use this? + #[allow(dead_code)] fn add_servers_invite_via(&self, room_id: &RoomId, servers: &[OwnedServerName]) -> Result<()>; } diff --git a/src/service/rooms/timeline/mod.rs b/src/service/rooms/timeline/mod.rs index fdc6ba67..88c43a5d 100644 --- a/src/service/rooms/timeline/mod.rs +++ b/src/service/rooms/timeline/mod.rs @@ -153,6 +153,9 @@ impl Service { */ /// Returns the version of a room, if known + /// + /// TODO: use this? + #[allow(dead_code)] pub(crate) fn get_room_version(&self, room_id: &RoomId) -> Result> { let create_event = services() .rooms @@ -188,6 +191,9 @@ impl Service { /// Returns the pdu. /// /// Checks the `eventid_outlierpdu` Tree if not found in the timeline. + /// + /// TODO: use this? + #[allow(dead_code)] pub(crate) fn get_non_outlier_pdu(&self, event_id: &EventId) -> Result> { self.db.get_non_outlier_pdu(event_id) } diff --git a/src/service/sending/data.rs b/src/service/sending/data.rs index 532a67d7..28ee6cb7 100644 --- a/src/service/sending/data.rs +++ b/src/service/sending/data.rs @@ -11,6 +11,9 @@ pub(crate) trait Data: Send + Sync { fn active_requests_for(&self, destination: &Destination) -> SendingEventTypeIter<'_>; fn delete_active_request(&self, key: Vec) -> Result<()>; fn delete_all_active_requests_for(&self, destination: &Destination) -> Result<()>; + + /// TODO: use this? + #[allow(dead_code)] fn delete_all_requests_for(&self, destination: &Destination) -> Result<()>; fn queue_requests(&self, requests: &[(&Destination, SendingEventType)]) -> Result>>; fn queued_requests<'a>( diff --git a/src/service/users/mod.rs b/src/service/users/mod.rs index 6889c57b..3ae9931d 100644 --- a/src/service/users/mod.rs +++ b/src/service/users/mod.rs @@ -337,6 +337,8 @@ impl Service { .add_one_time_key(user_id, device_id, one_time_key_key, one_time_key_value) } + // TODO: use this ? + #[allow(dead_code)] pub(crate) fn last_one_time_keys_update(&self, user_id: &UserId) -> Result { self.db.last_one_time_keys_update(user_id) }