mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
style: Rename unmark_pdu to clear_pdu_markers
This commit is contained in:
+12
-12
@@ -6,24 +6,24 @@ use std::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use conduwuit::{
|
use conduwuit::{
|
||||||
Err, Result, debug_error, err, info,
|
debug_error, err, info, matrix::{
|
||||||
matrix::{
|
|
||||||
Event,
|
|
||||||
pdu::{PduEvent, PduId, RawPduId},
|
pdu::{PduEvent, PduId, RawPduId},
|
||||||
},
|
Event,
|
||||||
trace, utils,
|
}, trace,
|
||||||
|
utils,
|
||||||
utils::{
|
utils::{
|
||||||
stream::{IterStream, ReadyExt},
|
stream::{IterStream, ReadyExt},
|
||||||
string::EMPTY,
|
string::EMPTY,
|
||||||
},
|
}, warn,
|
||||||
warn,
|
Err,
|
||||||
|
Result,
|
||||||
};
|
};
|
||||||
use futures::{FutureExt, StreamExt, TryStreamExt};
|
use futures::{FutureExt, StreamExt, TryStreamExt};
|
||||||
use lettre::message::Mailbox;
|
use lettre::message::Mailbox;
|
||||||
use ruma::{
|
use ruma::{
|
||||||
CanonicalJsonObject, CanonicalJsonValue, EventId, OwnedEventId, OwnedRoomId,
|
api::federation::event::get_room_state, events::AnyStateEvent, serde::Raw, CanonicalJsonObject, CanonicalJsonValue,
|
||||||
OwnedRoomOrAliasId, OwnedServerName, RoomId, RoomVersionId, UInt,
|
EventId, OwnedEventId, OwnedRoomId, OwnedRoomOrAliasId, OwnedServerName,
|
||||||
api::federation::event::get_room_state, events::AnyStateEvent, serde::Raw,
|
RoomId, RoomVersionId, UInt,
|
||||||
};
|
};
|
||||||
use service::rooms::{
|
use service::rooms::{
|
||||||
short::{ShortEventId, ShortRoomId},
|
short::{ShortEventId, ShortRoomId},
|
||||||
@@ -813,7 +813,7 @@ pub(super) async fn force_set_room_state_from_server(
|
|||||||
.await;
|
.await;
|
||||||
|
|
||||||
state.insert(shortstatekey, pdu.event_id.clone());
|
state.insert(shortstatekey, pdu.event_id.clone());
|
||||||
self.services.rooms.pdu_metadata.unmark_pdu(pdu.event_id());
|
self.services.rooms.pdu_metadata.clear_pdu_markers(pdu.event_id());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -831,7 +831,7 @@ pub(super) async fn force_set_room_state_from_server(
|
|||||||
.rooms
|
.rooms
|
||||||
.outlier
|
.outlier
|
||||||
.add_pdu_outlier(&event_id, &value);
|
.add_pdu_outlier(&event_id, &value);
|
||||||
self.services.rooms.pdu_metadata.unmark_pdu(&event_id);
|
self.services.rooms.pdu_metadata.clear_pdu_markers(&event_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
info!("Resolving new room state");
|
info!("Resolving new room state");
|
||||||
|
|||||||
@@ -1,46 +1,46 @@
|
|||||||
use std::{collections::HashMap, sync::Arc};
|
use std::{collections::HashMap, sync::Arc};
|
||||||
|
|
||||||
use conduwuit::{
|
use conduwuit::{
|
||||||
Err, Pdu, Result, Server, debug, debug_info, debug_warn, err, error, info, is_true,
|
debug, debug_info, debug_warn, err, error, info, is_true, matrix::{
|
||||||
matrix::{
|
|
||||||
StateKey,
|
|
||||||
event::{gen_event_id, gen_event_id_canonical_json},
|
event::{gen_event_id, gen_event_id_canonical_json},
|
||||||
},
|
StateKey,
|
||||||
pdu::PartialPdu,
|
}, pdu::PartialPdu, state_res, trace,
|
||||||
state_res, trace,
|
utils::{self, to_canonical_object, IterStream, ReadyExt},
|
||||||
utils::{self, IterStream, ReadyExt, to_canonical_object},
|
|
||||||
warn,
|
warn,
|
||||||
|
Err, Pdu,
|
||||||
|
Result,
|
||||||
|
Server,
|
||||||
};
|
};
|
||||||
use database::Database;
|
use database::Database;
|
||||||
use futures::{FutureExt, StreamExt, TryFutureExt, join};
|
use futures::{join, FutureExt, StreamExt, TryFutureExt};
|
||||||
use ruma::{
|
use ruma::{
|
||||||
CanonicalJsonObject, CanonicalJsonValue, OwnedRoomId, OwnedServerName, OwnedUserId, RoomId,
|
|
||||||
RoomVersionId, UserId,
|
|
||||||
api::{
|
api::{
|
||||||
error::{ErrorKind, IncompatibleRoomVersionErrorData},
|
error::{ErrorKind, IncompatibleRoomVersionErrorData},
|
||||||
federation,
|
federation,
|
||||||
},
|
}, canonical_json::to_canonical_value, events::{
|
||||||
canonical_json::to_canonical_value,
|
|
||||||
events::{
|
|
||||||
StateEventType, StaticEventContent,
|
|
||||||
room::{
|
room::{
|
||||||
join_rules::RoomJoinRulesEventContent,
|
join_rules::RoomJoinRulesEventContent,
|
||||||
member::{MembershipState, RoomMemberEventContent},
|
member::{MembershipState, RoomMemberEventContent},
|
||||||
},
|
}, StateEventType,
|
||||||
},
|
StaticEventContent,
|
||||||
room::{AllowRule, JoinRule},
|
}, room::{AllowRule, JoinRule}, CanonicalJsonObject, CanonicalJsonValue,
|
||||||
|
OwnedRoomId, OwnedServerName,
|
||||||
|
OwnedUserId,
|
||||||
|
RoomId,
|
||||||
|
RoomVersionId,
|
||||||
|
UserId,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
Dep, antispam, globals,
|
antispam, globals, rooms::{
|
||||||
rooms::{
|
|
||||||
metadata, outlier, pdu_metadata, short,
|
metadata, outlier, pdu_metadata, short,
|
||||||
state::{self, RoomMutexGuard},
|
state::{self, RoomMutexGuard},
|
||||||
state_accessor, state_cache,
|
state_accessor, state_cache,
|
||||||
state_compressor::{self, CompressedState, HashSetCompressStateEvent},
|
state_compressor::{self, CompressedState, HashSetCompressStateEvent},
|
||||||
timeline::{self, pdu_fits},
|
timeline::{self, pdu_fits},
|
||||||
},
|
},
|
||||||
sending, server_keys, users,
|
sending,
|
||||||
|
server_keys, users, Dep,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub struct Service {
|
pub struct Service {
|
||||||
@@ -515,7 +515,7 @@ impl Service {
|
|||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
self.services.outlier.add_pdu_outlier(&event_id, &value);
|
self.services.outlier.add_pdu_outlier(&event_id, &value);
|
||||||
self.services.pdu_metadata.unmark_pdu(&event_id);
|
self.services.pdu_metadata.clear_pdu_markers(&event_id);
|
||||||
if let Some(state_key) = &pdu.state_key {
|
if let Some(state_key) = &pdu.state_key {
|
||||||
let shortstatekey = self
|
let shortstatekey = self
|
||||||
.services
|
.services
|
||||||
@@ -547,7 +547,7 @@ impl Service {
|
|||||||
.ready_for_each(|(event_id, value)| {
|
.ready_for_each(|(event_id, value)| {
|
||||||
trace!(%event_id, "Adding PDU as an outlier from send_join auth_chain");
|
trace!(%event_id, "Adding PDU as an outlier from send_join auth_chain");
|
||||||
self.services.outlier.add_pdu_outlier(&event_id, &value);
|
self.services.outlier.add_pdu_outlier(&event_id, &value);
|
||||||
self.services.pdu_metadata.unmark_pdu(&event_id);
|
self.services.pdu_metadata.clear_pdu_markers(&event_id);
|
||||||
})
|
})
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
|
|||||||
@@ -4,22 +4,22 @@ use conduwuit::{
|
|||||||
arrayvec::ArrayVec,
|
arrayvec::ArrayVec,
|
||||||
matrix::{Event, PduCount},
|
matrix::{Event, PduCount},
|
||||||
utils::{
|
utils::{
|
||||||
ReadyExt,
|
|
||||||
stream::{TryIgnore, WidebandExt},
|
stream::{TryIgnore, WidebandExt},
|
||||||
u64_from_u8,
|
u64_from_u8,
|
||||||
|
ReadyExt,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use database::Map;
|
use database::Map;
|
||||||
use futures::{Stream, StreamExt};
|
use futures::{Stream, StreamExt};
|
||||||
use ruma::{EventId, RoomId, UserId, api::Direction};
|
use ruma::{api::Direction, EventId, RoomId, UserId};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
Dep,
|
|
||||||
rooms::{
|
rooms::{
|
||||||
self,
|
self,
|
||||||
short::{ShortEventId, ShortRoomId},
|
short::{ShortEventId, ShortRoomId},
|
||||||
timeline::{PduId, PdusIterItem, RawPduId},
|
timeline::{PduId, PdusIterItem, RawPduId},
|
||||||
},
|
},
|
||||||
|
Dep,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub(super) struct Data {
|
pub(super) struct Data {
|
||||||
@@ -141,7 +141,7 @@ impl Data {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Removes any soft-fail or rejection markers applied to the target PDU
|
/// Removes any soft-fail or rejection markers applied to the target PDU
|
||||||
pub(super) fn unmark_pdu(&self, event_id: &EventId) {
|
pub(super) fn clear_pdu_markers(&self, event_id: &EventId) {
|
||||||
self.unmark_event_rejected(event_id);
|
self.unmark_event_rejected(event_id);
|
||||||
self.unmark_event_soft_failed(event_id);
|
self.unmark_event_soft_failed(event_id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,14 +2,14 @@ mod bundled_aggregations;
|
|||||||
mod data;
|
mod data;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use conduwuit::{Result, matrix::PduCount};
|
use conduwuit::{matrix::PduCount, Result};
|
||||||
use futures::{StreamExt, future::try_join};
|
use futures::{future::try_join, StreamExt};
|
||||||
use ruma::{EventId, RoomId, UserId, api::Direction};
|
use ruma::{api::Direction, EventId, RoomId, UserId};
|
||||||
|
|
||||||
use self::data::Data;
|
use self::data::Data;
|
||||||
use crate::{
|
use crate::{
|
||||||
Dep,
|
|
||||||
rooms::{self, timeline::PdusIterItem},
|
rooms::{self, timeline::PdusIterItem},
|
||||||
|
Dep,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub struct Service {
|
pub struct Service {
|
||||||
@@ -163,5 +163,5 @@ impl Service {
|
|||||||
&& !self.db.is_event_soft_failed(event_id).await
|
&& !self.db.is_event_soft_failed(event_id).await
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn unmark_pdu(&self, event_id: &EventId) { self.db.unmark_pdu(event_id); }
|
pub fn clear_pdu_markers(&self, event_id: &EventId) { self.db.clear_pdu_markers(event_id); }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user