Refactor plugins, port message dropping bugfix from 0.5.1

This commit is contained in:
Lucien Greathouse
2019-10-14 14:05:25 -07:00
parent 9aafccc946
commit b0dcf515f0
2 changed files with 51 additions and 46 deletions

View File

@@ -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)