tdfischer / pto

IRC to Matrix bridge
Apache License 2.0
48 stars 8 forks source link

Chokes on redacted events #48

Closed ara4n closed 8 years ago

ara4n commented 8 years ago
thread '<unnamed>' panicked at 'Could not find content.body in {
  "content": {},
  "event_id": "$145639822736805QyaRC:matrix.org",
  "origin_server_ts": 1456398227266,
  "room_id": "!MXYrxNpfUOjyCOWVnQ:matrix.org",
  "sender": "@matthew:matrix.org",
  "type": "m.room.message",
  "unsigned": {
    "age": 1348667727,
    "redacted_because": {
      "content": {},
      "event_id": "$145639824036817LnRAA:matrix.org",
      "origin_server_ts": 1456398240555,
      "redacts": "$145639822736805QyaRC:matrix.org",
      "sender": "@matthew:matrix.org",
      "type": "m.room.redaction",
      "unsigned": {
        "age": 1348654438
      }
    },
    "redacted_by": "$145639824036817LnRAA:matrix.org"
  }
} (lost at body)', src/matrix/json.rs:25

It's valid for content to be empty for redacted events. (I'll take a quick look at fixing this now...)