mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 08:42:34 +01:00
modules/client/rooms/context: Allow a room_id as the event_id and fetch the room head.
This commit is contained in:
parent
0720b2f4c4
commit
7f7ecc90b3
1 changed files with 9 additions and 1 deletions
|
@ -55,9 +55,17 @@ get__context(client &client,
|
|||
const resource::request &request,
|
||||
const m::room::id &room_id)
|
||||
{
|
||||
if(request.parv.size() < 3)
|
||||
throw m::NEED_MORE_PARAMS
|
||||
{
|
||||
"event_id path parameter required"
|
||||
};
|
||||
|
||||
m::event::id::buf event_id
|
||||
{
|
||||
url::decode(event_id, request.parv[2])
|
||||
m::sigil(request.parv[2]) == m::id::EVENT?
|
||||
url::decode(event_id, request.parv[2]):
|
||||
m::head(room_id)
|
||||
};
|
||||
|
||||
const auto limit{[&request]
|
||||
|
|
Loading…
Reference in a new issue