diff options
author | Christian Hesse <mail@eworm.de> | 2021-06-15 14:39:42 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2021-06-15 16:59:02 +0200 |
commit | 1ce0f63ef7206e130981a2ab49f3fbda281b0a12 (patch) | |
tree | f1a37163d27c78c12d53320c56a8a99e3e6ca301 /log-forward | |
parent | babcc00dcd189058433100417d6568a15fe62cf1 (diff) |
log-forward: use $HexToNum, do not resend old messages
Now we know the order of messages and can compare. Changing the filter
does no longer result in old messages being resent.
Diffstat (limited to 'log-forward')
-rw-r--r-- | log-forward | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/log-forward b/log-forward index 2e66089..e0cb3aa 100644 --- a/log-forward +++ b/log-forward @@ -20,6 +20,7 @@ :global NotificationsWithSymbols; :global EscapeForRegEx; +:global HexToNum; :global IfThenElse; :global LogPrintExit2; :global QuotedPrintable; @@ -43,6 +44,7 @@ $WaitFullyConnected; :local Count 0; :local Duplicates false; +:local Last [ $HexToNum $LogForwardLast ]; :local Messages ""; :local MessageVal; :local MessageDups [ :toarray "" ]; @@ -55,12 +57,7 @@ $WaitFullyConnected; topics~$LogForwardInclude or message~$LogForwardIncludeMessage ] do={ :set MessageVal [ / log get $Message ]; - :if ($LogForwardLast = ($MessageVal->".id")) do={ - :set Count 0; - :set Duplicates false; - :set Messages ""; - :set MessageDups [ :toarray "" ]; - } else={ + :if ($Last < [ $HexToNum ($MessageVal->".id") ]) do={ :local DupCount ($MessageDups->($MessageVal->"message")); :if ($DupCount < 3) do={ :set Messages ($Messages . "\n" . [ $IfThenElse ($NotificationsWithSymbols = true) (" \E2\97\8F ") ] . \ |