mirror of
https://forgejo.ellis.link/continuwuation/continuwuity/
synced 2026-05-13 18:03:07 +00:00
style: Rename unmark_pdu to clear_pdu_markers
This commit is contained in:
+12
-12
@@ -6,24 +6,24 @@
|
||||
};
|
||||
|
||||
use conduwuit::{
|
||||
Err, Result, debug_error, err, info,
|
||||
matrix::{
|
||||
Event,
|
||||
debug_error, err, info, matrix::{
|
||||
pdu::{PduEvent, PduId, RawPduId},
|
||||
},
|
||||
trace, utils,
|
||||
Event,
|
||||
}, trace,
|
||||
utils,
|
||||
utils::{
|
||||
stream::{IterStream, ReadyExt},
|
||||
string::EMPTY,
|
||||
},
|
||||
warn,
|
||||
}, warn,
|
||||
Err,
|
||||
Result,
|
||||
};
|
||||
use futures::{FutureExt, StreamExt, TryStreamExt};
|
||||
use lettre::message::Mailbox;
|
||||
use ruma::{
|
||||
CanonicalJsonObject, CanonicalJsonValue, EventId, OwnedEventId, OwnedRoomId,
|
||||
OwnedRoomOrAliasId, OwnedServerName, RoomId, RoomVersionId, UInt,
|
||||
api::federation::event::get_room_state, events::AnyStateEvent, serde::Raw,
|
||||
api::federation::event::get_room_state, events::AnyStateEvent, serde::Raw, CanonicalJsonObject, CanonicalJsonValue,
|
||||
EventId, OwnedEventId, OwnedRoomId, OwnedRoomOrAliasId, OwnedServerName,
|
||||
RoomId, RoomVersionId, UInt,
|
||||
};
|
||||
use service::rooms::{
|
||||
short::{ShortEventId, ShortRoomId},
|
||||
@@ -813,7 +813,7 @@ pub(super) async fn force_set_room_state_from_server(
|
||||
.await;
|
||||
|
||||
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
|
||||
.outlier
|
||||
.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");
|
||||
|
||||
@@ -1,46 +1,46 @@
|
||||
use std::{collections::HashMap, sync::Arc};
|
||||
|
||||
use conduwuit::{
|
||||
Err, Pdu, Result, Server, debug, debug_info, debug_warn, err, error, info, is_true,
|
||||
matrix::{
|
||||
StateKey,
|
||||
debug, debug_info, debug_warn, err, error, info, is_true, matrix::{
|
||||
event::{gen_event_id, gen_event_id_canonical_json},
|
||||
},
|
||||
pdu::PartialPdu,
|
||||
state_res, trace,
|
||||
utils::{self, IterStream, ReadyExt, to_canonical_object},
|
||||
StateKey,
|
||||
}, pdu::PartialPdu, state_res, trace,
|
||||
utils::{self, to_canonical_object, IterStream, ReadyExt},
|
||||
warn,
|
||||
Err, Pdu,
|
||||
Result,
|
||||
Server,
|
||||
};
|
||||
use database::Database;
|
||||
use futures::{FutureExt, StreamExt, TryFutureExt, join};
|
||||
use futures::{join, FutureExt, StreamExt, TryFutureExt};
|
||||
use ruma::{
|
||||
CanonicalJsonObject, CanonicalJsonValue, OwnedRoomId, OwnedServerName, OwnedUserId, RoomId,
|
||||
RoomVersionId, UserId,
|
||||
api::{
|
||||
error::{ErrorKind, IncompatibleRoomVersionErrorData},
|
||||
federation,
|
||||
},
|
||||
canonical_json::to_canonical_value,
|
||||
events::{
|
||||
StateEventType, StaticEventContent,
|
||||
}, canonical_json::to_canonical_value, events::{
|
||||
room::{
|
||||
join_rules::RoomJoinRulesEventContent,
|
||||
member::{MembershipState, RoomMemberEventContent},
|
||||
},
|
||||
},
|
||||
room::{AllowRule, JoinRule},
|
||||
}, StateEventType,
|
||||
StaticEventContent,
|
||||
}, room::{AllowRule, JoinRule}, CanonicalJsonObject, CanonicalJsonValue,
|
||||
OwnedRoomId, OwnedServerName,
|
||||
OwnedUserId,
|
||||
RoomId,
|
||||
RoomVersionId,
|
||||
UserId,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
Dep, antispam, globals,
|
||||
rooms::{
|
||||
antispam, globals, rooms::{
|
||||
metadata, outlier, pdu_metadata, short,
|
||||
state::{self, RoomMutexGuard},
|
||||
state_accessor, state_cache,
|
||||
state_compressor::{self, CompressedState, HashSetCompressStateEvent},
|
||||
timeline::{self, pdu_fits},
|
||||
},
|
||||
sending, server_keys, users,
|
||||
sending,
|
||||
server_keys, users, Dep,
|
||||
};
|
||||
|
||||
pub struct Service {
|
||||
@@ -517,7 +517,7 @@ pub async fn join_remote_room(
|
||||
return state;
|
||||
}
|
||||
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 {
|
||||
let shortstatekey = self
|
||||
.services
|
||||
@@ -549,7 +549,7 @@ pub async fn join_remote_room(
|
||||
.ready_for_each(|(event_id, value)| {
|
||||
trace!(%event_id, "Adding PDU as an outlier from send_join auth_chain");
|
||||
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;
|
||||
|
||||
|
||||
@@ -4,22 +4,22 @@
|
||||
arrayvec::ArrayVec,
|
||||
matrix::{Event, PduCount},
|
||||
utils::{
|
||||
ReadyExt,
|
||||
stream::{TryIgnore, WidebandExt},
|
||||
u64_from_u8,
|
||||
ReadyExt,
|
||||
},
|
||||
};
|
||||
use database::Map;
|
||||
use futures::{Stream, StreamExt};
|
||||
use ruma::{EventId, RoomId, UserId, api::Direction};
|
||||
use ruma::{api::Direction, EventId, RoomId, UserId};
|
||||
|
||||
use crate::{
|
||||
Dep,
|
||||
rooms::{
|
||||
self,
|
||||
short::{ShortEventId, ShortRoomId},
|
||||
timeline::{PduId, PdusIterItem, RawPduId},
|
||||
},
|
||||
Dep,
|
||||
};
|
||||
|
||||
pub(super) struct Data {
|
||||
@@ -141,7 +141,7 @@ pub(super) async fn is_event_rejected(&self, event_id: &EventId) -> bool {
|
||||
}
|
||||
|
||||
/// 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_soft_failed(event_id);
|
||||
}
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
mod data;
|
||||
use std::sync::Arc;
|
||||
|
||||
use conduwuit::{Result, matrix::PduCount};
|
||||
use futures::{StreamExt, future::try_join};
|
||||
use ruma::{EventId, RoomId, UserId, api::Direction};
|
||||
use conduwuit::{matrix::PduCount, Result};
|
||||
use futures::{future::try_join, StreamExt};
|
||||
use ruma::{api::Direction, EventId, RoomId, UserId};
|
||||
|
||||
use self::data::Data;
|
||||
use crate::{
|
||||
Dep,
|
||||
rooms::{self, timeline::PdusIterItem},
|
||||
Dep,
|
||||
};
|
||||
|
||||
pub struct Service {
|
||||
@@ -163,5 +163,5 @@ pub async fn is_event_accepted(&self, event_id: &EventId) -> bool {
|
||||
&& !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