|
10 | 10 | * [Undoing room shutdowns](#undoing-room-shutdowns) |
11 | 11 | - [Make Room Admin API](#make-room-admin-api) |
12 | 12 | - [Forward Extremities Admin API](#forward-extremities-admin-api) |
| 13 | +- [Event Context API](#event-context-api) |
13 | 14 |
|
14 | 15 | # List Room API |
15 | 16 |
|
@@ -594,3 +595,121 @@ that were deleted. |
594 | 595 | "deleted": 1 |
595 | 596 | } |
596 | 597 | ``` |
| 598 | + |
| 599 | +# Event Context API |
| 600 | + |
| 601 | +This API lets a client find the context of an event. This is designed primarily to investigate abuse reports. |
| 602 | + |
| 603 | +``` |
| 604 | +GET /_synapse/admin/v1/rooms/<room_id>/context/<event_id> |
| 605 | +``` |
| 606 | + |
| 607 | +This API mimmicks [GET /_matrix/client/r0/rooms/{roomId}/context/{eventId}](https://matrix.org/docs/spec/client_server/r0.6.1#get-matrix-client-r0-rooms-roomid-context-eventid). Please refer to the link for all details on parameters and reseponse. |
| 608 | + |
| 609 | +Example response: |
| 610 | + |
| 611 | +```json |
| 612 | +{ |
| 613 | + "end": "t29-57_2_0_2", |
| 614 | + "events_after": [ |
| 615 | + { |
| 616 | + "content": { |
| 617 | + "body": "This is an example text message", |
| 618 | + "msgtype": "m.text", |
| 619 | + "format": "org.matrix.custom.html", |
| 620 | + "formatted_body": "<b>This is an example text message</b>" |
| 621 | + }, |
| 622 | + "type": "m.room.message", |
| 623 | + "event_id": "$143273582443PhrSn:example.org", |
| 624 | + "room_id": "!636q39766251:example.com", |
| 625 | + "sender": "@example:example.org", |
| 626 | + "origin_server_ts": 1432735824653, |
| 627 | + "unsigned": { |
| 628 | + "age": 1234 |
| 629 | + } |
| 630 | + } |
| 631 | + ], |
| 632 | + "event": { |
| 633 | + "content": { |
| 634 | + "body": "filename.jpg", |
| 635 | + "info": { |
| 636 | + "h": 398, |
| 637 | + "w": 394, |
| 638 | + "mimetype": "image/jpeg", |
| 639 | + "size": 31037 |
| 640 | + }, |
| 641 | + "url": "mxc://example.org/JWEIFJgwEIhweiWJE", |
| 642 | + "msgtype": "m.image" |
| 643 | + }, |
| 644 | + "type": "m.room.message", |
| 645 | + "event_id": "$f3h4d129462ha:example.com", |
| 646 | + "room_id": "!636q39766251:example.com", |
| 647 | + "sender": "@example:example.org", |
| 648 | + "origin_server_ts": 1432735824653, |
| 649 | + "unsigned": { |
| 650 | + "age": 1234 |
| 651 | + } |
| 652 | + }, |
| 653 | + "events_before": [ |
| 654 | + { |
| 655 | + "content": { |
| 656 | + "body": "something-important.doc", |
| 657 | + "filename": "something-important.doc", |
| 658 | + "info": { |
| 659 | + "mimetype": "application/msword", |
| 660 | + "size": 46144 |
| 661 | + }, |
| 662 | + "msgtype": "m.file", |
| 663 | + "url": "mxc://example.org/FHyPlCeYUSFFxlgbQYZmoEoe" |
| 664 | + }, |
| 665 | + "type": "m.room.message", |
| 666 | + "event_id": "$143273582443PhrSn:example.org", |
| 667 | + "room_id": "!636q39766251:example.com", |
| 668 | + "sender": "@example:example.org", |
| 669 | + "origin_server_ts": 1432735824653, |
| 670 | + "unsigned": { |
| 671 | + "age": 1234 |
| 672 | + } |
| 673 | + } |
| 674 | + ], |
| 675 | + "start": "t27-54_2_0_2", |
| 676 | + "state": [ |
| 677 | + { |
| 678 | + "content": { |
| 679 | + "creator": "@example:example.org", |
| 680 | + "room_version": "1", |
| 681 | + "m.federate": true, |
| 682 | + "predecessor": { |
| 683 | + "event_id": "$something:example.org", |
| 684 | + "room_id": "!oldroom:example.org" |
| 685 | + } |
| 686 | + }, |
| 687 | + "type": "m.room.create", |
| 688 | + "event_id": "$143273582443PhrSn:example.org", |
| 689 | + "room_id": "!636q39766251:example.com", |
| 690 | + "sender": "@example:example.org", |
| 691 | + "origin_server_ts": 1432735824653, |
| 692 | + "unsigned": { |
| 693 | + "age": 1234 |
| 694 | + }, |
| 695 | + "state_key": "" |
| 696 | + }, |
| 697 | + { |
| 698 | + "content": { |
| 699 | + "membership": "join", |
| 700 | + "avatar_url": "mxc://example.org/SEsfnsuifSDFSSEF", |
| 701 | + "displayname": "Alice Margatroid" |
| 702 | + }, |
| 703 | + "type": "m.room.member", |
| 704 | + "event_id": "$143273582443PhrSn:example.org", |
| 705 | + "room_id": "!636q39766251:example.com", |
| 706 | + "sender": "@example:example.org", |
| 707 | + "origin_server_ts": 1432735824653, |
| 708 | + "unsigned": { |
| 709 | + "age": 1234 |
| 710 | + }, |
| 711 | + "state_key": "@alice:example.org" |
| 712 | + } |
| 713 | + ] |
| 714 | +} |
| 715 | +``` |
0 commit comments