From 959c3c9c9bc8773c09ffb7606573a11c423ef0ab Mon Sep 17 00:00:00 2001 From: Jeremy Baxter Date: Sun, 1 Jan 2023 10:57:22 +1300 Subject: [PATCH] Add cache.disable logic (oops...) --- matrix-send | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/matrix-send b/matrix-send index 6a9b479..392e393 100755 --- a/matrix-send +++ b/matrix-send @@ -340,10 +340,12 @@ if not login.token then login.token = t.access_token -- Cache the access token - mkdir(cache.location) - cf = io.open(cache.location .. "/token", 'w+') - cf:write(login.token) - cf:close() + if not cache.disable then + mkdir(cache.location) + cf = io.open(cache.location .. "/token", 'w+') + cf:write(login.token) + cf:close() + end end end @@ -358,6 +360,8 @@ if t.error then end -- Increment txnid and cache -txnidf = io.open(cache.location .. "/txnid", 'w+') -txnidf:write(txnid + 1) -txnidf:close() +if not cache.disable then + txnidf = io.open(cache.location .. "/txnid", 'w+') + txnidf:write(txnid + 1) + txnidf:close() +end