Use the /sync endpoing instead /initialSync

The /initialSync endpoint is deprecated. This renames the api:initial_sync()
method to api:sync(), and uses the new endpoint.
This commit is contained in:
Adrian Perez de Castro
2016-06-30 00:12:55 +03:00
parent 0a58777f42
commit 5a23cb5b85

View File

@@ -72,9 +72,27 @@ function API:__tostring()
return self.__name .. "{" .. self.base_url .. "}" return self.__name .. "{" .. self.base_url .. "}"
end end
----
function API:initial_sync(limit) -- | Option | Type | Default Value |
return self:_send("GET", "/initialSync", { limit = limit or 1 }) -- |:=========|:========|===============|
-- | filter | string | nil |
-- | since | string | nil |
-- | full | boolean | false |
-- | online | boolean | true |
-- | timeout | number | nil |
----
function API:sync(options)
local params
if options then
params = {
filter = options.filter,
ince = options.since,
full_state = options.full or false,
set_presence = online and nil or "offline",
timeout = options.timeout,
}
end
return self:_send("GET", "/sync", params)
end end
function API:register(login_type, params) function API:register(login_type, params)