Merge remote-tracking branch 'origin/master' into federation

This commit is contained in:
Timo Kösters 2020-09-12 22:13:53 +02:00
commit e6b1f54857
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
22 changed files with 925 additions and 169 deletions

View file

@ -34,7 +34,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 {
@ -70,7 +70,9 @@ 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();