Skip to content
Snippets Groups Projects
Commit 59c40623 authored by Jason Volk's avatar Jason Volk
Browse files

set trivial/leaf spans to debug level


Signed-off-by: default avatarJason Volk <jason@zemos.net>
parent 113a27c1
No related branches found
No related tags found
1 merge request!513Maintenance/Fixes
Showing
with 79 additions and 79 deletions
......@@ -64,7 +64,7 @@ pub struct PduEvent {
}
impl PduEvent {
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn redact(&mut self, room_version_id: RoomVersionId, reason: &Self) -> crate::Result<()> {
self.unsigned = None;
......@@ -158,7 +158,7 @@ pub fn copy_redacts(&self) -> (Option<Arc<EventId>>, Box<RawJsonValue>) {
(self.redacts.clone(), self.content.clone())
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn to_sync_room_event(&self) -> Raw<AnySyncTimelineEvent> {
let (redacts, content) = self.copy_redacts();
let mut json = json!({
......@@ -183,7 +183,7 @@ pub fn to_sync_room_event(&self) -> Raw<AnySyncTimelineEvent> {
}
/// This only works for events that are also AnyRoomEvents.
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn to_any_event(&self) -> Raw<AnyEphemeralRoomEvent> {
let (redacts, content) = self.copy_redacts();
let mut json = json!({
......@@ -208,7 +208,7 @@ pub fn to_any_event(&self) -> Raw<AnyEphemeralRoomEvent> {
serde_json::from_value(json).expect("Raw::from_value always works")
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn to_room_event(&self) -> Raw<AnyTimelineEvent> {
let (redacts, content) = self.copy_redacts();
let mut json = json!({
......@@ -233,7 +233,7 @@ pub fn to_room_event(&self) -> Raw<AnyTimelineEvent> {
serde_json::from_value(json).expect("Raw::from_value always works")
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn to_message_like_event(&self) -> Raw<AnyMessageLikeEvent> {
let (redacts, content) = self.copy_redacts();
let mut json = json!({
......@@ -258,7 +258,7 @@ pub fn to_message_like_event(&self) -> Raw<AnyMessageLikeEvent> {
serde_json::from_value(json).expect("Raw::from_value always works")
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn to_state_event(&self) -> Raw<AnyStateEvent> {
let mut json = json!({
"content": self.content,
......@@ -277,7 +277,7 @@ pub fn to_state_event(&self) -> Raw<AnyStateEvent> {
serde_json::from_value(json).expect("Raw::from_value always works")
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn to_sync_state_event(&self) -> Raw<AnySyncStateEvent> {
let mut json = json!({
"content": self.content,
......@@ -295,7 +295,7 @@ pub fn to_sync_state_event(&self) -> Raw<AnySyncStateEvent> {
serde_json::from_value(json).expect("Raw::from_value always works")
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn to_stripped_state_event(&self) -> Raw<AnyStrippedStateEvent> {
let json = json!({
"content": self.content,
......@@ -307,7 +307,7 @@ pub fn to_stripped_state_event(&self) -> Raw<AnyStrippedStateEvent> {
serde_json::from_value(json).expect("Raw::from_value always works")
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn to_stripped_spacechild_state_event(&self) -> Raw<HierarchySpaceChildEvent> {
let json = json!({
"content": self.content,
......@@ -320,7 +320,7 @@ pub fn to_stripped_spacechild_state_event(&self) -> Raw<HierarchySpaceChildEvent
serde_json::from_value(json).expect("Raw::from_value always works")
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn to_member_event(&self) -> Raw<StateEvent<RoomMemberEventContent>> {
let mut json = json!({
"content": self.content,
......
......@@ -66,7 +66,7 @@ pub fn content_disposition_type(content_type: &Option<String>) -> &'static str {
/// sanitises the file name for the Content-Disposition using
/// `sanitize_filename` crate
#[tracing::instrument]
#[tracing::instrument(level = "debug")]
pub fn sanitise_filename(filename: String) -> String {
let options = sanitize_filename::Options {
truncate: false,
......
use ring::{digest, digest::SHA256};
#[tracing::instrument(skip_all)]
#[tracing::instrument(skip_all, level = "debug")]
pub(super) fn hash(keys: &[&[u8]]) -> Vec<u8> {
// We only hash the pdu's event ids, not the whole pdu
let bytes = keys.join(&0xFF);
......
......@@ -9,7 +9,7 @@
};
use tracing::{debug, error, trace};
#[tracing::instrument(skip_all)]
#[tracing::instrument(skip_all, level = "debug")]
pub(crate) async fn spawn(
State(server): State<Arc<Server>>, req: http::Request<axum::body::Body>, next: axum::middleware::Next,
) -> Result<axum::response::Response, StatusCode> {
......
......@@ -44,7 +44,7 @@ pub fn get(
}
/// Returns all changes to the account data that happened after `since`.
#[tracing::instrument(skip_all, name = "since")]
#[tracing::instrument(skip_all, name = "since", level = "debug")]
pub fn changes_since(
&self, room_id: Option<&RoomId>, user_id: &UserId, since: u64,
) -> Result<HashMap<RoomAccountDataEventType, Raw<AnyEphemeralRoomEvent>>> {
......
......@@ -110,7 +110,7 @@ pub fn update_check_for_updates_id(&self, id: u64) -> Result<()> {
Ok(())
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub async fn watch(&self, user_id: &UserId, device_id: &DeviceId) -> Result<()> {
let userid_bytes = user_id.as_bytes().to_vec();
let mut userid_prefix = userid_bytes.clone();
......
......@@ -189,10 +189,10 @@ pub fn next_count(&self) -> Result<u64> { self.db.next_count() }
#[inline]
pub fn current_count(&self) -> Result<u64> { Ok(self.db.current_count()) }
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn last_check_for_updates_id(&self) -> Result<u64> { self.db.last_check_for_updates_id() }
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn update_check_for_updates_id(&self, id: u64) -> Result<()> { self.db.update_check_for_updates_id(id) }
pub async fn watch(&self, user_id: &UserId, device_id: &DeviceId) -> Result<()> {
......
......@@ -186,7 +186,7 @@ pub async fn send_push_notice(
Ok(())
}
#[tracing::instrument(skip(self, user, ruleset, pdu))]
#[tracing::instrument(skip(self, user, ruleset, pdu), level = "debug")]
pub fn get_actions<'a>(
&self, user: &UserId, ruleset: &'a Ruleset, power_levels: &RoomPowerLevelsEventContent,
pdu: &Raw<AnySyncTimelineEvent>, room_id: &RoomId,
......
......@@ -89,19 +89,19 @@ pub async fn resolve_alias(
)
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn resolve_local_alias(&self, alias: &RoomAliasId) -> Result<Option<OwnedRoomId>> {
self.db.resolve_local_alias(alias)
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn local_aliases_for_room<'a>(
&'a self, room_id: &RoomId,
) -> Box<dyn Iterator<Item = Result<OwnedRoomAliasId>> + 'a> {
self.db.local_aliases_for_room(room_id)
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn all_local_aliases<'a>(&'a self) -> Box<dyn Iterator<Item = Result<(OwnedRoomId, String)>> + 'a> {
self.db.all_local_aliases()
}
......
......@@ -174,13 +174,13 @@ pub fn get_cached_eventid_authchain(&self, key: &[u64]) -> Result<Option<Arc<[u6
self.db.get_cached_eventid_authchain(key)
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn cache_auth_chain(&self, key: Vec<u64>, auth_chain: &HashSet<u64>) -> Result<()> {
self.db
.cache_auth_chain(key, auth_chain.iter().copied().collect::<Arc<[u64]>>())
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn cache_auth_chain_vec(&self, key: Vec<u64>, auth_chain: &Vec<u64>) -> Result<()> {
self.db
.cache_auth_chain(key, auth_chain.iter().copied().collect::<Arc<[u64]>>())
......
......@@ -22,15 +22,15 @@ fn name(&self) -> &str { crate::service::make_name(std::module_path!()) }
}
impl Service {
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn set_public(&self, room_id: &RoomId) -> Result<()> { self.db.set_public(room_id) }
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn set_not_public(&self, room_id: &RoomId) -> Result<()> { self.db.set_not_public(room_id) }
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn is_public_room(&self, room_id: &RoomId) -> Result<bool> { self.db.is_public_room(room_id) }
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn public_rooms(&self) -> impl Iterator<Item = Result<OwnedRoomId>> + '_ { self.db.public_rooms() }
}
......@@ -3,6 +3,7 @@
time::{Duration, SystemTime},
};
use conduit::{debug, error, info, trace, warn};
use futures_util::{stream::FuturesUnordered, StreamExt};
use ruma::{
api::federation::{
......@@ -19,7 +20,6 @@
};
use serde_json::value::RawValue as RawJsonValue;
use tokio::sync::{RwLock, RwLockWriteGuard};
use tracing::{debug, error, info, trace, warn};
use crate::{services, Error, Result};
......
......@@ -39,7 +39,7 @@ fn name(&self) -> &str { crate::service::make_name(std::module_path!()) }
}
impl Service {
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn lazy_load_was_sent_before(
&self, user_id: &UserId, device_id: &DeviceId, room_id: &RoomId, ll_user: &UserId,
) -> Result<bool> {
......@@ -47,7 +47,7 @@ pub fn lazy_load_was_sent_before(
.lazy_load_was_sent_before(user_id, device_id, room_id, ll_user)
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub async fn lazy_load_mark_sent(
&self, user_id: &UserId, device_id: &DeviceId, room_id: &RoomId, lazy_load: HashSet<OwnedUserId>,
count: PduCount,
......@@ -58,7 +58,7 @@ pub async fn lazy_load_mark_sent(
.insert((user_id.to_owned(), device_id.to_owned(), room_id.to_owned(), count), lazy_load);
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub async fn lazy_load_confirm_delivery(
&self, user_id: &UserId, device_id: &DeviceId, room_id: &RoomId, since: PduCount,
) -> Result<()> {
......@@ -77,7 +77,7 @@ pub async fn lazy_load_confirm_delivery(
Ok(())
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn lazy_load_reset(&self, user_id: &UserId, device_id: &DeviceId, room_id: &RoomId) -> Result<()> {
self.db.lazy_load_reset(user_id, device_id, room_id)
}
......
......@@ -35,7 +35,7 @@ pub fn get_outlier_pdu_json(&self, event_id: &EventId) -> Result<Option<Canonica
pub fn get_pdu_outlier(&self, event_id: &EventId) -> Result<Option<PduEvent>> { self.db.get_outlier_pdu(event_id) }
/// Append the PDU as an outlier.
#[tracing::instrument(skip(self, pdu))]
#[tracing::instrument(skip(self, pdu), level = "debug")]
pub fn add_pdu_outlier(&self, event_id: &EventId, pdu: &CanonicalJsonObject) -> Result<()> {
self.db.add_pdu_outlier(event_id, pdu)
}
......
......@@ -38,7 +38,7 @@ fn name(&self) -> &str { crate::service::make_name(std::module_path!()) }
}
impl Service {
#[tracing::instrument(skip(self, from, to))]
#[tracing::instrument(skip(self, from, to), level = "debug")]
pub fn add_relation(&self, from: PduCount, to: PduCount) -> Result<()> {
match (from, to) {
(PduCount::Normal(f), PduCount::Normal(t)) => self.db.add_relation(f, t),
......@@ -218,19 +218,19 @@ pub fn relations_until<'a>(
})
}
#[tracing::instrument(skip(self, room_id, event_ids))]
#[tracing::instrument(skip_all, level = "debug")]
pub fn mark_as_referenced(&self, room_id: &RoomId, event_ids: &[Arc<EventId>]) -> Result<()> {
self.db.mark_as_referenced(room_id, event_ids)
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn is_event_referenced(&self, room_id: &RoomId, event_id: &EventId) -> Result<bool> {
self.db.is_event_referenced(room_id, event_id)
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn mark_event_soft_failed(&self, event_id: &EventId) -> Result<()> { self.db.mark_event_soft_failed(event_id) }
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn is_event_soft_failed(&self, event_id: &EventId) -> Result<bool> { self.db.is_event_soft_failed(event_id) }
}
......@@ -33,7 +33,7 @@ pub fn readreceipt_update(&self, user_id: &UserId, room_id: &RoomId, event: &Rec
/// Returns an iterator over the most recent read_receipts in a room that
/// happened after the event with id `since`.
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn readreceipts_since<'a>(
&'a self, room_id: &RoomId, since: u64,
) -> impl Iterator<Item = Result<(OwnedUserId, u64, Raw<ruma::events::AnySyncEphemeralRoomEvent>)>> + 'a {
......@@ -41,13 +41,13 @@ pub fn readreceipts_since<'a>(
}
/// Sets a private read marker at `count`.
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn private_read_set(&self, room_id: &RoomId, user_id: &UserId, count: u64) -> Result<()> {
self.db.private_read_set(room_id, user_id, count)
}
/// Returns the private read marker.
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn private_read_get(&self, room_id: &RoomId, user_id: &UserId) -> Result<Option<u64>> {
self.db.private_read_get(room_id, user_id)
}
......
......@@ -21,17 +21,17 @@ fn name(&self) -> &str { crate::service::make_name(std::module_path!()) }
}
impl Service {
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn index_pdu(&self, shortroomid: u64, pdu_id: &[u8], message_body: &str) -> Result<()> {
self.db.index_pdu(shortroomid, pdu_id, message_body)
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn deindex_pdu(&self, shortroomid: u64, pdu_id: &[u8], message_body: &str) -> Result<()> {
self.db.deindex_pdu(shortroomid, pdu_id, message_body)
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn search_pdus<'a>(
&'a self, room_id: &RoomId, search_string: &str,
) -> Result<Option<(impl Iterator<Item = Vec<u8>> + 'a, Vec<String>)>> {
......
......@@ -116,7 +116,7 @@ pub async fn force_state(
///
/// This adds all current state events (not including the incoming event)
/// to `stateid_pduid` and adds the incoming event to `eventid_statehash`.
#[tracing::instrument(skip(self, state_ids_compressed))]
#[tracing::instrument(skip(self, state_ids_compressed), level = "debug")]
pub fn set_event_state(
&self, event_id: &EventId, room_id: &RoomId, state_ids_compressed: Arc<HashSet<CompressedStateEvent>>,
) -> Result<u64> {
......@@ -184,7 +184,7 @@ pub fn set_event_state(
///
/// This adds all current state events (not including the incoming event)
/// to `stateid_pduid` and adds the incoming event to `eventid_statehash`.
#[tracing::instrument(skip(self, new_pdu))]
#[tracing::instrument(skip(self, new_pdu), level = "debug")]
pub fn append_to_state(&self, new_pdu: &PduEvent) -> Result<u64> {
let shorteventid = services()
.rooms
......@@ -257,7 +257,7 @@ pub fn append_to_state(&self, new_pdu: &PduEvent) -> Result<u64> {
}
}
#[tracing::instrument(skip(self, invite_event))]
#[tracing::instrument(skip(self, invite_event), level = "debug")]
pub fn calculate_invite_state(&self, invite_event: &PduEvent) -> Result<Vec<Raw<AnyStrippedStateEvent>>> {
let mut state = Vec::new();
// Add recommended events
......@@ -313,7 +313,7 @@ pub fn calculate_invite_state(&self, invite_event: &PduEvent) -> Result<Vec<Raw<
}
/// Set the state hash to a new version, but does not update state_cache.
#[tracing::instrument(skip(self, mutex_lock))]
#[tracing::instrument(skip(self, mutex_lock), level = "debug")]
pub fn set_room_state(
&self,
room_id: &RoomId,
......@@ -324,7 +324,7 @@ pub fn set_room_state(
}
/// Returns the room's version.
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn get_room_version(&self, room_id: &RoomId) -> Result<RoomVersionId> {
let create_event = services()
.rooms
......@@ -365,7 +365,7 @@ pub fn set_forward_extremities(
}
/// This fetches auth events from the current state.
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn get_auth_events(
&self, room_id: &RoomId, kind: &TimelineEventType, sender: &UserId, state_key: Option<&str>,
content: &serde_json::value::RawValue,
......
......@@ -81,7 +81,7 @@ fn name(&self) -> &str { crate::service::make_name(std::module_path!()) }
impl Service {
/// Builds a StateMap by iterating over all keys that start
/// with state_hash, this gives the full state for the given state_hash.
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub async fn state_full_ids(&self, shortstatehash: u64) -> Result<HashMap<u64, Arc<EventId>>> {
self.db.state_full_ids(shortstatehash).await
}
......@@ -92,7 +92,7 @@ pub async fn state_full(&self, shortstatehash: u64) -> Result<HashMap<(StateEven
/// Returns a single PDU from `room_id` with key (`event_type`,
/// `state_key`).
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn state_get_id(
&self, shortstatehash: u64, event_type: &StateEventType, state_key: &str,
) -> Result<Option<Arc<EventId>>> {
......@@ -286,14 +286,14 @@ pub fn user_can_see_state_events(&self, user_id: &UserId, room_id: &RoomId) -> R
pub fn pdu_shortstatehash(&self, event_id: &EventId) -> Result<Option<u64>> { self.db.pdu_shortstatehash(event_id) }
/// Returns the full room state.
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub async fn room_state_full(&self, room_id: &RoomId) -> Result<HashMap<(StateEventType, String), Arc<PduEvent>>> {
self.db.room_state_full(room_id).await
}
/// Returns a single PDU from `room_id` with key (`event_type`,
/// `state_key`).
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn room_state_get_id(
&self, room_id: &RoomId, event_type: &StateEventType, state_key: &str,
) -> Result<Option<Arc<EventId>>> {
......@@ -302,7 +302,7 @@ pub fn room_state_get_id(
/// Returns a single PDU from `room_id` with key (`event_type`,
/// `state_key`).
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub fn room_state_get(
&self, room_id: &RoomId, event_type: &StateEventType, state_key: &str,
) -> Result<Option<Arc<PduEvent>>> {
......
......@@ -213,7 +213,7 @@ pub(super) fn update_joined_count(&self, room_id: &RoomId) -> Result<()> {
Ok(())
}
#[tracing::instrument(skip(self, room_id, appservice))]
#[tracing::instrument(skip(self, room_id, appservice), level = "debug")]
pub(super) fn appservice_in_room(&self, room_id: &RoomId, appservice: &RegistrationInfo) -> Result<bool> {
let maybe = self
.appservice_in_room_cache
......@@ -249,7 +249,7 @@ pub(super) fn appservice_in_room(&self, room_id: &RoomId, appservice: &Registrat
}
/// Makes a user forget a room.
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub(super) fn forget(&self, room_id: &RoomId, user_id: &UserId) -> Result<()> {
let mut userroom_id = user_id.as_bytes().to_vec();
userroom_id.push(0xFF);
......@@ -266,7 +266,7 @@ pub(super) fn forget(&self, room_id: &RoomId, user_id: &UserId) -> Result<()> {
}
/// Returns an iterator of all servers participating in this room.
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub(super) fn room_servers<'a>(
&'a self, room_id: &RoomId,
) -> Box<dyn Iterator<Item = Result<OwnedServerName>> + 'a> {
......@@ -286,7 +286,7 @@ pub(super) fn room_servers<'a>(
}))
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub(super) fn server_in_room(&self, server: &ServerName, room_id: &RoomId) -> Result<bool> {
let mut key = server.as_bytes().to_vec();
key.push(0xFF);
......@@ -297,7 +297,7 @@ pub(super) fn server_in_room(&self, server: &ServerName, room_id: &RoomId) -> Re
/// Returns an iterator of all rooms a server participates in (as far as we
/// know).
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub(super) fn server_rooms<'a>(
&'a self, server: &ServerName,
) -> Box<dyn Iterator<Item = Result<OwnedRoomId>> + 'a> {
......@@ -318,7 +318,7 @@ pub(super) fn server_rooms<'a>(
}
/// Returns an iterator of all joined members of a room.
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub(super) fn room_members<'a>(
&'a self, room_id: &RoomId,
) -> Box<dyn Iterator<Item = Result<OwnedUserId>> + Send + 'a> {
......@@ -350,7 +350,7 @@ pub(super) fn local_users_in_room<'a>(&'a self, room_id: &RoomId) -> Box<dyn Ite
/// Returns an iterator of all our local joined users in a room who are
/// active (not deactivated, not guest)
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub(super) fn active_local_users_in_room<'a>(
&'a self, room_id: &RoomId,
) -> Box<dyn Iterator<Item = OwnedUserId> + 'a> {
......@@ -361,7 +361,7 @@ pub(super) fn active_local_users_in_room<'a>(
}
/// Returns the number of users which are currently in a room
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub(super) fn room_joined_count(&self, room_id: &RoomId) -> Result<Option<u64>> {
self.roomid_joinedcount
.get(room_id.as_bytes())?
......@@ -370,7 +370,7 @@ pub(super) fn room_joined_count(&self, room_id: &RoomId) -> Result<Option<u64>>
}
/// Returns the number of users which are currently invited to a room
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub(super) fn room_invited_count(&self, room_id: &RoomId) -> Result<Option<u64>> {
self.roomid_invitedcount
.get(room_id.as_bytes())?
......@@ -379,7 +379,7 @@ pub(super) fn room_invited_count(&self, room_id: &RoomId) -> Result<Option<u64>>
}
/// Returns an iterator over all User IDs who ever joined a room.
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub(super) fn room_useroncejoined<'a>(
&'a self, room_id: &RoomId,
) -> Box<dyn Iterator<Item = Result<OwnedUserId>> + 'a> {
......@@ -404,7 +404,7 @@ pub(super) fn room_useroncejoined<'a>(
}
/// Returns an iterator over all invited members of a room.
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub(super) fn room_members_invited<'a>(
&'a self, room_id: &RoomId,
) -> Box<dyn Iterator<Item = Result<OwnedUserId>> + 'a> {
......@@ -428,7 +428,7 @@ pub(super) fn room_members_invited<'a>(
)
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub(super) fn get_invite_count(&self, room_id: &RoomId, user_id: &UserId) -> Result<Option<u64>> {
let mut key = room_id.as_bytes().to_vec();
key.push(0xFF);
......@@ -443,7 +443,7 @@ pub(super) fn get_invite_count(&self, room_id: &RoomId, user_id: &UserId) -> Res
})
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub(super) fn get_left_count(&self, room_id: &RoomId, user_id: &UserId) -> Result<Option<u64>> {
let mut key = room_id.as_bytes().to_vec();
key.push(0xFF);
......@@ -456,7 +456,7 @@ pub(super) fn get_left_count(&self, room_id: &RoomId, user_id: &UserId) -> Resul
}
/// Returns an iterator over all rooms this user joined.
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub(super) fn rooms_joined(&self, user_id: &UserId) -> Box<dyn Iterator<Item = Result<OwnedRoomId>> + '_> {
Box::new(
self.userroomid_joined
......@@ -476,7 +476,7 @@ pub(super) fn rooms_joined(&self, user_id: &UserId) -> Box<dyn Iterator<Item = R
}
/// Returns an iterator over all rooms a user was invited to.
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub(super) fn rooms_invited<'a>(&'a self, user_id: &UserId) -> StrippedStateEventIter<'a> {
let mut prefix = user_id.as_bytes().to_vec();
prefix.push(0xFF);
......@@ -503,7 +503,7 @@ pub(super) fn rooms_invited<'a>(&'a self, user_id: &UserId) -> StrippedStateEven
)
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub(super) fn invite_state(
&self, user_id: &UserId, room_id: &RoomId,
) -> Result<Option<Vec<Raw<AnyStrippedStateEvent>>>> {
......@@ -522,7 +522,7 @@ pub(super) fn invite_state(
.transpose()
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub(super) fn left_state(
&self, user_id: &UserId, room_id: &RoomId,
) -> Result<Option<Vec<Raw<AnyStrippedStateEvent>>>> {
......@@ -542,7 +542,7 @@ pub(super) fn left_state(
}
/// Returns an iterator over all rooms a user left.
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub(super) fn rooms_left<'a>(&'a self, user_id: &UserId) -> AnySyncStateEventIter<'a> {
let mut prefix = user_id.as_bytes().to_vec();
prefix.push(0xFF);
......@@ -569,7 +569,7 @@ pub(super) fn rooms_left<'a>(&'a self, user_id: &UserId) -> AnySyncStateEventIte
)
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub(super) fn once_joined(&self, user_id: &UserId, room_id: &RoomId) -> Result<bool> {
let mut userroom_id = user_id.as_bytes().to_vec();
userroom_id.push(0xFF);
......@@ -578,7 +578,7 @@ pub(super) fn once_joined(&self, user_id: &UserId, room_id: &RoomId) -> Result<b
Ok(self.roomuseroncejoinedids.get(&userroom_id)?.is_some())
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub(super) fn is_joined(&self, user_id: &UserId, room_id: &RoomId) -> Result<bool> {
let mut userroom_id = user_id.as_bytes().to_vec();
userroom_id.push(0xFF);
......@@ -587,7 +587,7 @@ pub(super) fn is_joined(&self, user_id: &UserId, room_id: &RoomId) -> Result<boo
Ok(self.userroomid_joined.get(&userroom_id)?.is_some())
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub(super) fn is_invited(&self, user_id: &UserId, room_id: &RoomId) -> Result<bool> {
let mut userroom_id = user_id.as_bytes().to_vec();
userroom_id.push(0xFF);
......@@ -596,7 +596,7 @@ pub(super) fn is_invited(&self, user_id: &UserId, room_id: &RoomId) -> Result<bo
Ok(self.userroomid_invitestate.get(&userroom_id)?.is_some())
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub(super) fn is_left(&self, user_id: &UserId, room_id: &RoomId) -> Result<bool> {
let mut userroom_id = user_id.as_bytes().to_vec();
userroom_id.push(0xFF);
......@@ -605,7 +605,7 @@ pub(super) fn is_left(&self, user_id: &UserId, room_id: &RoomId) -> Result<bool>
Ok(self.userroomid_leftstate.get(&userroom_id)?.is_some())
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub(super) fn servers_invite_via<'a>(
&'a self, room_id: &RoomId,
) -> Box<dyn Iterator<Item = Result<OwnedServerName>> + 'a> {
......@@ -631,7 +631,7 @@ pub(super) fn servers_invite_via<'a>(
)
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self), level = "debug")]
pub(super) fn add_servers_invite_via(&self, room_id: &RoomId, servers: &[OwnedServerName]) -> Result<()> {
let mut prev_servers = self
.servers_invite_via(room_id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment