refactor: Rename PduBuilder to PartialPdu

This commit is contained in:
Ginger committed 2026-04-28 09:16:51 -04:00
1 parent bf9c9716eb
commit 97a01a1500
27 files changed
+95 -95

No files matched your search

+10 -10
View File
@@ -1,6 +1,6 @@
use std::collections::BTreeMap;
use conduwuit::{Result, info, pdu::PduBuilder};
use conduwuit::{Result, info, pdu::PartialPdu};
use futures::FutureExt;
use ruma::{
RoomId, RoomVersionId,
@@ -58,7 +58,7 @@ pub async fn create_admin_room(services: &Services) -> Result {
.rooms
.timeline
.build_and_append_pdu(
PduBuilder::state(String::new(), &create_content),
PartialPdu::state(String::new(), &create_content),
server_user,
Some(&room_id),
&state_lock,
@@ -71,7 +71,7 @@ pub async fn create_admin_room(services: &Services) -> Result {
.rooms
.timeline
.build_and_append_pdu(
PduBuilder::state(
PartialPdu::state(
String::from(server_user),
&RoomMemberEventContent::new(MembershipState::Join),
),
@@ -93,7 +93,7 @@ pub async fn create_admin_room(services: &Services) -> Result {
.rooms
.timeline
.build_and_append_pdu(
PduBuilder::state(String::new(), &power_levels_content),
PartialPdu::state(String::new(), &power_levels_content),
server_user,
Some(&room_id),
&state_lock,
@@ -106,7 +106,7 @@ pub async fn create_admin_room(services: &Services) -> Result {
.rooms
.timeline
.build_and_append_pdu(
PduBuilder::state(String::new(), &RoomJoinRulesEventContent::new(JoinRule::Invite)),
PartialPdu::state(String::new(), &RoomJoinRulesEventContent::new(JoinRule::Invite)),
server_user,
Some(&room_id),
&state_lock,
@@ -119,7 +119,7 @@ pub async fn create_admin_room(services: &Services) -> Result {
.rooms
.timeline
.build_and_append_pdu(
PduBuilder::state(
PartialPdu::state(
String::new(),
&RoomHistoryVisibilityEventContent::new(HistoryVisibility::Shared),
),
@@ -135,7 +135,7 @@ pub async fn create_admin_room(services: &Services) -> Result {
.rooms
.timeline
.build_and_append_pdu(
PduBuilder::state(
PartialPdu::state(
String::new(),
&RoomGuestAccessEventContent::new(GuestAccess::Forbidden),
),
@@ -152,7 +152,7 @@ pub async fn create_admin_room(services: &Services) -> Result {
.rooms
.timeline
.build_and_append_pdu(
PduBuilder::state(String::new(), &RoomNameEventContent::new(room_name)),
PartialPdu::state(String::new(), &RoomNameEventContent::new(room_name)),
server_user,
Some(&room_id),
&state_lock,
@@ -165,7 +165,7 @@ pub async fn create_admin_room(services: &Services) -> Result {
.rooms
.timeline
.build_and_append_pdu(
PduBuilder::state(String::new(), &RoomTopicEventContent::markdown(room_topic)),
PartialPdu::state(String::new(), &RoomTopicEventContent::markdown(room_topic)),
server_user,
Some(&room_id),
&state_lock,
@@ -181,7 +181,7 @@ pub async fn create_admin_room(services: &Services) -> Result {
.rooms
.timeline
.build_and_append_pdu(
PduBuilder::state(String::new(), &alias_content),
PartialPdu::state(String::new(), &alias_content),
server_user,
Some(&room_id),
&state_lock,
+6 -6
View File
@@ -1,7 +1,7 @@
use std::collections::BTreeMap;
use conduwuit::{
Err, Result, debug_info, debug_warn, error, implement, matrix::pdu::PduBuilder, warn,
Err, Result, debug_info, debug_warn, error, implement, matrix::pdu::PartialPdu, warn,
};
use ruma::{
RoomId, UserId,
@@ -51,7 +51,7 @@ pub async fn make_user_admin(&self, user_id: &UserId) -> Result {
self.services
.timeline
.build_and_append_pdu(
PduBuilder::state(
PartialPdu::state(
String::from(user_id),
&RoomMemberEventContent::new(MembershipState::Invite),
),
@@ -65,7 +65,7 @@ pub async fn make_user_admin(&self, user_id: &UserId) -> Result {
self.services
.timeline
.build_and_append_pdu(
PduBuilder::state(
PartialPdu::state(
String::from(user_id),
&RoomMemberEventContent::new(MembershipState::Join),
),
@@ -79,7 +79,7 @@ pub async fn make_user_admin(&self, user_id: &UserId) -> Result {
self.services
.timeline
.build_and_append_pdu(
PduBuilder::state(
PartialPdu::state(
user_id.to_string(),
&RoomMemberEventContent::new(MembershipState::Invite),
),
@@ -110,7 +110,7 @@ pub async fn make_user_admin(&self, user_id: &UserId) -> Result {
self.services
.timeline
.build_and_append_pdu(
PduBuilder::state(String::new(), &room_power_levels),
PartialPdu::state(String::new(), &room_power_levels),
server_user,
Some(&room_id),
&state_lock,
@@ -207,7 +207,7 @@ pub async fn revoke_admin(&self, user_id: &UserId) -> Result {
self.services
.timeline
.build_and_append_pdu(
PduBuilder::state(user_id.to_string(), &member_content),
PartialPdu::state(user_id.to_string(), &member_content),
self.services.globals.server_user.as_ref(),
Some(&room_id),
&state_lock,
+3 -3
View File
@@ -11,7 +11,7 @@ use std::{
use async_trait::async_trait;
use conduwuit::{Err, SyncRwLock, utils};
use conduwuit_core::{
Error, Event, Result, Server, debug, err, error, error::default_log, pdu::PduBuilder,
Error, Event, Result, Server, debug, err, error, error::default_log, pdu::PartialPdu,
};
pub use create::create_admin_room;
use futures::{Future, FutureExt, StreamExt, TryFutureExt};
@@ -493,7 +493,7 @@ impl Service {
.services
.timeline
.build_and_append_pdu(
PduBuilder::timeline(&self.text_or_file(content).await),
PartialPdu::timeline(&self.text_or_file(content).await),
user_id,
Some(room_id),
&state_lock,
@@ -525,7 +525,7 @@ impl Service {
self.services
.timeline
.build_and_append_pdu(
PduBuilder::timeline(&content),
PartialPdu::timeline(&content),
user_id,
Some(room_id),
state_lock,