Add cache.disable logic (oops...)

This commit is contained in:
Jeremy 2023-01-01 10:57:22 +13:00
parent 75de7727d0
commit 88e373a777

View file

@ -340,12 +340,14 @@ if not login.token then
login.token = t.access_token login.token = t.access_token
-- Cache the access token -- Cache the access token
if not cache.disable then
mkdir(cache.location) mkdir(cache.location)
cf = io.open(cache.location .. "/token", 'w+') cf = io.open(cache.location .. "/token", 'w+')
cf:write(login.token) cf:write(login.token)
cf:close() cf:close()
end end
end end
end
uri.message = string.format("https://%s/_matrix/client/v3/rooms/%s/send/m.room.message/%d?access_token=%s", uri.message = string.format("https://%s/_matrix/client/v3/rooms/%s/send/m.room.message/%d?access_token=%s",
login.server, room_id, txnid, login.token) login.server, room_id, txnid, login.token)
@ -358,6 +360,8 @@ if t.error then
end end
-- Increment txnid and cache -- Increment txnid and cache
if not cache.disable then
txnidf = io.open(cache.location .. "/txnid", 'w+') txnidf = io.open(cache.location .. "/txnid", 'w+')
txnidf:write(txnid + 1) txnidf:write(txnid + 1)
txnidf:close() txnidf:close()
end