Refactor `LinkPreviewer` to take an event and put the functions for getting the link in the class itself. This means the functions in `EventHandler` are no longer required. This mr also sets up `LinkPreviewer` so that it is automatically updated when an event is edited. This includes changing the link if edited, and it can handle a message having a previous link removed or a one added when one didn't exist before. Also adds test suite.
25 lines
578 B
JSON
25 lines
578 B
JSON
{
|
|
"timeline": {
|
|
"events": [
|
|
{
|
|
"content": {
|
|
"body": "https://kde.org",
|
|
"format": "org.matrix.custom.html",
|
|
"formatted_body": "https://kde.org",
|
|
"msgtype": "m.text"
|
|
},
|
|
"origin_server_ts": 1704648567967,
|
|
"sender": "@example:example.org",
|
|
"type": "m.room.message",
|
|
"unsigned": {
|
|
"age": 112
|
|
},
|
|
"event_id": "$validlink:example.org",
|
|
"room_id": "!test:example.org"
|
|
}
|
|
],
|
|
"limited": true,
|
|
"prev_batch": "t34-23535_0_0"
|
|
}
|
|
}
|