Fix spec misconception

Apparently, the  field is also meant for other reasons than the cputime         unlimited
filesize        unlimited
datasize        unlimited
stacksize       8MB
coredumpsize    unlimited
resident        unlimited
maxproc         62741
descriptors     524288
memorylocked    8MB
addressspace    unlimited
maxfilelocks    unlimited
sigpending      62741
msgqueue        819200
nice            0
rt_priority     0
rt_time         unlimited field on the filter, despite the description suggesting otherwise.
pull/31/head
Bram 2024-07-13 09:38:57 +02:00
parent 1aecb1116a
commit 39f8021a8f
4 changed files with 155 additions and 41 deletions

View File

@ -104,9 +104,9 @@ syncV1 data =
, coder = V1.coderSyncResponse
, contextChange = always identity
, method = "GET"
, path = [ "_matrix", "client", "r0", "sync" ]
, path = [ "_matrix", "client", "v3", "sync" ]
, toUpdate =
V1.updateSyncResponse { filter = Filter.pass, since = data.since }
Debug.log "Handling output v1" >> V1.updateSyncResponse { filter = Filter.pass, since = data.since } >> Debug.log "Received"
}
@ -126,9 +126,9 @@ syncV2 data =
, coder = V2.coderSyncResponse
, contextChange = always identity
, method = "GET"
, path = [ "_matrix", "client", "r0", "sync" ]
, path = [ "_matrix", "client", "v3", "sync" ]
, toUpdate =
V2.updateSyncResponse { filter = Filter.pass, since = data.since }
Debug.log "Handling output v2" >> V2.updateSyncResponse { filter = Filter.pass, since = data.since } >> Debug.log "Received"
}
@ -148,9 +148,9 @@ syncV3 data =
, coder = V3.coderSyncResponse
, contextChange = always identity
, method = "GET"
, path = [ "_matrix", "client", "r0", "sync" ]
, path = [ "_matrix", "client", "v3", "sync" ]
, toUpdate =
V3.updateSyncResponse { filter = Filter.pass, since = data.since }
Debug.log "Handling output v3" >> V3.updateSyncResponse { filter = Filter.pass, since = data.since } >> Debug.log "Received"
}
@ -170,7 +170,7 @@ syncV4 data =
, coder = V4.coderSyncResponse
, contextChange = always identity
, method = "GET"
, path = [ "_matrix", "client", "r0", "sync" ]
, path = [ "_matrix", "client", "v3", "sync" ]
, toUpdate =
V4.updateSyncResponse { filter = Filter.pass, since = data.since }
Debug.log "Handling output v4" >> V4.updateSyncResponse { filter = Filter.pass, since = data.since } >> Debug.log "Received"
}

View File

@ -935,18 +935,56 @@ updateTimeline { filter, nextBatch, roomId, since } timeline =
timeline.events
|> Maybe.map
(\events ->
R.AddSync
{ events = List.map (toEvent roomId) events
, filter = filter
, start =
case timeline.prevBatch of
Just _ ->
timeline.prevBatch
let
limited : Bool
limited =
Maybe.withDefault False timeline.limited
Nothing ->
since
, end = nextBatch
}
newEvents : List Event.Event
newEvents =
List.map (toEvent roomId) events
in
case ( limited, timeline.prevBatch ) of
( False, Just p ) ->
if timeline.prevBatch == since then
R.AddSync
{ events = newEvents
, filter = filter
, start = Just p
, end = nextBatch
}
else
R.More
[ R.AddSync
{ events = []
, filter = filter
, start = since
, end = p
}
, R.AddSync
{ events = newEvents
, filter = filter
, start = Just p
, end = nextBatch
}
]
( False, Nothing ) ->
R.AddSync
{ events = newEvents
, filter = filter
, start = since
, end = nextBatch
}
( True, _ ) ->
R.AddSync
{ events = newEvents
, filter = filter
, start = timeline.prevBatch
, end = nextBatch
}
)

View File

@ -683,18 +683,56 @@ updateJoinedRoom data room =
updateTimeline : { filter : Filter, nextBatch : String, roomId : String, since : Maybe String } -> Timeline -> R.RoomUpdate
updateTimeline { filter, nextBatch, roomId, since } timeline =
R.AddSync
{ events = List.map (toEvent roomId) timeline.events
, filter = filter
, start =
case timeline.prevBatch of
Just _ ->
timeline.prevBatch
let
limited : Bool
limited =
Maybe.withDefault False timeline.limited
Nothing ->
since
, end = nextBatch
}
newEvents : List Event.Event
newEvents =
List.map (toEvent roomId) timeline.events
in
case ( limited, timeline.prevBatch ) of
( False, Just p ) ->
if timeline.prevBatch == since then
R.AddSync
{ events = newEvents
, filter = filter
, start = Just p
, end = nextBatch
}
else
R.More
[ R.AddSync
{ events = []
, filter = filter
, start = since
, end = p
}
, R.AddSync
{ events = newEvents
, filter = filter
, start = Just p
, end = nextBatch
}
]
( False, Nothing ) ->
R.AddSync
{ events = newEvents
, filter = filter
, start = since
, end = nextBatch
}
( True, _ ) ->
R.AddSync
{ events = newEvents
, filter = filter
, start = timeline.prevBatch
, end = nextBatch
}
toEvent : String -> ClientEventWithoutRoomID -> Event.Event

View File

@ -952,18 +952,56 @@ updateJoinedRoom data room =
updateTimeline : { filter : Filter, nextBatch : String, roomId : String, since : Maybe String } -> Timeline -> R.RoomUpdate
updateTimeline { filter, nextBatch, roomId, since } timeline =
R.AddSync
{ events = List.map (toEvent roomId) timeline.events
, filter = filter
, start =
case timeline.prevBatch of
Just _ ->
timeline.prevBatch
let
limited : Bool
limited =
Maybe.withDefault False timeline.limited
Nothing ->
since
, end = nextBatch
}
newEvents : List Event.Event
newEvents =
List.map (toEvent roomId) timeline.events
in
case ( limited, timeline.prevBatch ) of
( False, Just p ) ->
if timeline.prevBatch == since then
R.AddSync
{ events = newEvents
, filter = filter
, start = Just p
, end = nextBatch
}
else
R.More
[ R.AddSync
{ events = []
, filter = filter
, start = since
, end = p
}
, R.AddSync
{ events = newEvents
, filter = filter
, start = Just p
, end = nextBatch
}
]
( False, Nothing ) ->
R.AddSync
{ events = newEvents
, filter = filter
, start = since
, end = nextBatch
}
( True, _ ) ->
R.AddSync
{ events = newEvents
, filter = filter
, start = timeline.prevBatch
, end = nextBatch
}
toEvent : String -> ClientEventWithoutRoomID -> Event.Event