Fix undeclared req
This commit is contained in:
parent
26da26f7a6
commit
945e0c5820
5
init.lua
5
init.lua
|
@ -136,10 +136,11 @@ function MatrixChat:send(msg)
|
|||
local u = self.server .."/_matrix/client/r0/rooms/".. self.room .."/send/m.room.message/" .. txid -- ?access_token=..token
|
||||
local h = {"Content-Type: application/json", "Authorization: Bearer " .. self.token}
|
||||
local d = minetest.write_json({msgtype="m.text", body=msg})
|
||||
local req
|
||||
if self.proxy then
|
||||
local req = {url=u, method="POST", extra_headers=h, post_data=d}
|
||||
req = {url=u, method="POST", extra_headers=h, post_data=d}
|
||||
else
|
||||
local req = {url=u, method="PUT", extra_headers=h, data=d}
|
||||
req = {url=u, method="PUT", extra_headers=h, data=d}
|
||||
end
|
||||
http.fetch(req,
|
||||
function(res)
|
||||
|
|
Loading…
Reference in New Issue