mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-20 17:41:37 +00:00
Refactor plugins, port message dropping bugfix from 0.5.1
This commit is contained in:
parent
9aafccc946
commit
b0dcf515f0
2 changed files with 51 additions and 46 deletions
|
|
@ -92,6 +92,10 @@ function ApiContext:disconnect()
|
|||
self.__connected = false
|
||||
end
|
||||
|
||||
function ApiContext:setMessageCursor(index)
|
||||
self.__messageCursor = index
|
||||
end
|
||||
|
||||
function ApiContext:connect()
|
||||
local url = ("%s/api/rojo"):format(self.__baseUrl)
|
||||
|
||||
|
|
@ -125,8 +129,6 @@ function ApiContext:read(ids)
|
|||
|
||||
assert(validateApiRead(body))
|
||||
|
||||
self.__messageCursor = body.messageCursor
|
||||
|
||||
return body
|
||||
end)
|
||||
end
|
||||
|
|
@ -155,7 +157,7 @@ function ApiContext:retrieveMessages()
|
|||
|
||||
assert(validateApiSubscribe(body))
|
||||
|
||||
self.__messageCursor = body.messageCursor
|
||||
self:setMessageCursor(body.messageCursor)
|
||||
|
||||
return body.messages
|
||||
end)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue