fix: put reason of redaction in the redacted event
This commit is contained in:
@@ -35,7 +35,7 @@ pub struct PduEvent {
|
||||
}
|
||||
|
||||
impl PduEvent {
|
||||
pub fn redact(&mut self) -> Result<()> {
|
||||
pub fn redact(&mut self, reason: &PduEvent) -> Result<()> {
|
||||
self.unsigned.clear();
|
||||
|
||||
let allowed: &[&str] = match self.kind {
|
||||
@@ -71,7 +71,7 @@ impl PduEvent {
|
||||
|
||||
self.unsigned.insert(
|
||||
"redacted_because".to_owned(),
|
||||
json!({"content": {}, "type": "m.room.redaction"}),
|
||||
serde_json::to_string(reason).expect("PduEvent::to_string always works").into()
|
||||
);
|
||||
|
||||
self.content = new_content.into();
|
||||
|
||||
Reference in New Issue
Block a user