Add constructions and Default for PduBuilder
simplify various RoomMemberEventContent constructions Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
f503ed918c
commit
e482c0646f
16 changed files with 279 additions and 564 deletions
|
@ -21,11 +21,10 @@ use ruma::{
|
|||
message::RoomMessageEventContent,
|
||||
power_levels::{RoomPowerLevels, RoomPowerLevelsEventContent},
|
||||
},
|
||||
GlobalAccountDataEventType, StateEventType, TimelineEventType,
|
||||
GlobalAccountDataEventType, StateEventType,
|
||||
},
|
||||
push, OwnedRoomId, UserId,
|
||||
};
|
||||
use serde_json::value::to_raw_value;
|
||||
use service::Services;
|
||||
|
||||
use super::{join_room_by_id_helper, DEVICE_ID_LENGTH, SESSION_ID_LENGTH, TOKEN_LENGTH};
|
||||
|
@ -747,14 +746,7 @@ pub async fn full_user_deactivate(
|
|||
.rooms
|
||||
.timeline
|
||||
.build_and_append_pdu(
|
||||
PduBuilder {
|
||||
event_type: TimelineEventType::RoomPowerLevels,
|
||||
content: to_raw_value(&power_levels_content).expect("event is valid, we just created it"),
|
||||
unsigned: None,
|
||||
state_key: Some(String::new()),
|
||||
redacts: None,
|
||||
timestamp: None,
|
||||
},
|
||||
PduBuilder::state(String::new(), &power_levels_content),
|
||||
user_id,
|
||||
room_id,
|
||||
&state_lock,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue