fix: put reason of redaction in the redacted event
This commit is contained in:
parent
7ba9263cc6
commit
38663228f5
2 changed files with 6 additions and 20 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue