Push /get-event to spec versions v1.7 and v1.8

main
Bram van den Heuvel 2023-09-22 14:56:47 +02:00
parent c91f77bab8
commit 18fd7426c9
3 changed files with 22 additions and 3 deletions

View File

@ -19,6 +19,18 @@ type alias GetEventOutputV1 =
getEventInputV1 : GetEventInputV1 -> Context { a | accessToken : (), baseUrl : (), sentEvent : () } -> Task X.Error GetEventOutputV1
getEventInputV1 data context =
context
|> R.callApi "GET" "/_matrix/client/r0/rooms/{roomId}/event/{eventId}"
|> R.withAttributes
[ R.accessToken
, R.replaceInUrl "eventId" (Context.getSentEvent context)
, R.replaceInUrl "roomId" data.roomId
, R.onStatusCode 404 (X.M_NOT_FOUND { error = Just SE.eventNotFound })
]
|> R.toTask SO1.clientEventDecoder
getEventInputV2 : GetEventInputV1 -> Context { a | accessToken : (), baseUrl : (), sentEvent : () } -> Task X.Error GetEventOutputV1
getEventInputV2 data context =
context
|> R.callApi "GET" "/_matrix/client/v3/rooms/{roomId}/event/{eventId}"
|> R.withAttributes

View File

@ -15,12 +15,19 @@ getEvent context input =
}
|> VC.sameForVersion "r0.6.0"
|> VC.sameForVersion "r0.6.1"
|> VC.sameForVersion "v1.1"
|> VC.addMiddleLayer
{ downcast = identity
, current = Api.getEventInputV2
, upcast = identity
, version = "v1.1"
}
|> VC.sameForVersion "v1.2"
|> VC.sameForVersion "v1.3"
|> VC.sameForVersion "v1.4"
|> VC.sameForVersion "v1.5"
|> VC.sameForVersion "v1.6"
|> VC.sameForVersion "v1.7"
|> VC.sameForVersion "v1.8"
|> VC.mostRecentFromVersionList (Context.getVersions context)
|> Maybe.withDefault (always <| always <| Task.fail X.UnsupportedSpecVersion)
|> (|>) input

View File

@ -64,8 +64,8 @@ Note that **under development** doesn't always mean that it _will be_ supported.
| **Spec version** | | Event | Joined members | Event at timestamp |
| ---------------- | - | ----- | -------------- | ------------------ |
| v1.8 || | ⚡ | ⚡ |
| v1.7 || | ⚡ | ⚡ |
| v1.8 || ✔️ | ⚡ | ⚡ |
| v1.7 || ✔️ | ⚡ | ⚡ |
| v1.6 || ✔️ | ✔️ | ⚠️ |
| v1.5 || ✔️ | ✔️ | ⛔ |
| v1.4 || ✔️ | ✔️ | ⛔ |