cleaned up MatrixChat:get_sync_table()
This commit is contained in:
parent
dab7d2f5b8
commit
04cf7b139e
8
init.lua
8
init.lua
|
@ -66,16 +66,14 @@ end
|
|||
-- GET /sync
|
||||
function MatrixChat:get_sync_table(timeout)
|
||||
local params = {}
|
||||
-- no filter param
|
||||
if self.since ~= nil then
|
||||
params[1] = "since=" .. self.since
|
||||
table.insert(params, "since=" .. self.since)
|
||||
end
|
||||
if timeout ~= nil then
|
||||
-- if timeout is defined and since took the starting '?'
|
||||
params[2] = "timeout=" .. timeout
|
||||
table.insert(params, "timeout=" .. timeout)
|
||||
end
|
||||
local u = self.server .."/_matrix/client/r0/sync"
|
||||
if params[1] ~= nil then
|
||||
if #params > 0 then
|
||||
u = u .. "?" .. table.concat(params, "&")
|
||||
end
|
||||
local h = {"Authorization: Bearer " .. self.token}
|
||||
|
|
Loading…
Reference in New Issue