diff options
author | Christian Hesse <mail@eworm.de> | 2022-05-12 11:04:43 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2022-05-12 11:04:43 +0200 |
commit | df547b87a47e279d3f6b744675821621eea5d7b8 (patch) | |
tree | d5b33fb62e10637d70d8d0616437294ceb15ed9f /sms-forward | |
parent | 93ec9afe558ef6eba5d513fab359bb5f6618666d (diff) | |
parent | 12655bd58afc3a75fe3e2958bbe130b96f8b9be7 (diff) |
Merge branch 'ros-v7-path-syntax' into next
Diffstat (limited to 'sms-forward')
-rw-r--r-- | sms-forward | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sms-forward b/sms-forward index 436985d..b392805 100644 --- a/sms-forward +++ b/sms-forward @@ -21,27 +21,27 @@ $ScriptLock $0; -:if ([ / tool sms get receive-enabled ] = false) do={ +:if ([ /tool/sms/get receive-enabled ] = false) do={ $LogPrintExit2 warning $0 ("Receiving of SMS is not enabled.") true; } $WaitFullyConnected; -:local Settings [ / tool sms get ]; +:local Settings [ /tool/sms/get ]; # forward SMS in a loop -:while ([ :len [ / tool sms inbox find ] ] > 0) do={ - :local Phone [ / tool sms inbox get ([ find ]->0) phone ]; +:while ([ :len [ /tool/sms/inbox/find ] ] > 0) do={ + :local Phone [ /tool/sms/inbox/get ([ find ]->0) phone ]; :local Messages ""; :local Delete [ :toarray "" ]; - :foreach Sms in=[ / tool sms inbox find where phone=$Phone ] do={ - :local SmsVal [ / tool sms inbox get $Sms ]; + :foreach Sms in=[ /tool/sms/inbox/find where phone=$Phone ] do={ + :local SmsVal [ /tool/sms/inbox/get $Sms ]; :if ($Phone = $Settings->"allowed-number" && \ ($SmsVal->"message")~("^:cmd " . $Settings->"secret" . " script ")) do={ $LogPrintExit2 debug $0 ("Removing SMS, which started a script.") false; - / tool sms inbox remove $Sms; + /tool/sms/inbox/remove $Sms; } else={ :set Messages ($Messages . "\n\nOn " . $SmsVal->"timestamp" . \ " type " . $SmsVal->"type" . ":\n" . $SmsVal->"message"); @@ -56,7 +56,7 @@ $WaitFullyConnected; message=("Received " . [ $IfThenElse ($Count = 1) "this message" ("these " . $Count . " messages") ] . \ " by " . $Identity . " from " . $Phone . ":" . $Messages) }); :foreach Sms in=$Delete do={ - / tool sms inbox remove $Sms; + /tool/sms/inbox/remove $Sms; } } } |