matrix-ipfs-bot

git clone git://archive.git.mtrnord.blog/MTRNord/matrix-ipfs-bot.git
Log | Files | Refs | LICENSE

get_room_event.rs (1066B)


      1 // you may have to import this, make sure it's the same version as matrix-sdk has it bit me before
      2 use ruma_api::ruma_api;
      3 // these should be matrix_sdk::whatever...
      4 use matrix_sdk::events::{collections::all::RoomEvent, EventJson};
      5 use matrix_sdk::identifiers::{EventId, RoomId};
      6 
      7 ruma_api! {
      8     metadata {
      9         description: "Get a single event based on roomId/eventId",
     10         method: GET,
     11         name: "get_room_event",
     12         path: "/_matrix/client/r0/rooms/:room_id/event/:event_id",
     13         rate_limited: false,
     14         requires_authentication: true,
     15     }
     16 
     17     request {
     18         /// The ID of the room the event is in.
     19         #[ruma_api(path)]
     20         pub room_id: RoomId,
     21 
     22         /// The ID of the event.
     23         #[ruma_api(path)]
     24         pub event_id: EventId,
     25     }
     26 
     27     response {
     28         /// Arbitrary JSON of the event body. Returns both room and state events.
     29         #[ruma_api(body)]
     30         pub event: EventJson<RoomEvent>,
     31     }
     32 
     33     // Not positive about this one but I think the import is right
     34     error: matrix_sdk_common::api::Error
     35 }