Skip to content

Commit

Permalink
Fix bug in how mark file mtime was being set
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrubake committed Apr 29, 2024
1 parent 6db8fcd commit d73ca73
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions msgdrop
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,12 @@ send() {
recv() {
if [ -f "$keypair.mark" ] && [ "$all" != "y" ]; then
now=$(stat --printf %Y "$keypair.mark")
human_now=$(stat --printf %y "$keypair.mark")
since="&since=$now"
# Set mark file mtime
touch -d "$human_now" "$keypair.mark"
else
touch "$keypair.mark"
fi

curl -s "ntfy.sh/$(getid "$keypair.pub")/raw?poll=1$since" |
Expand All @@ -276,10 +281,6 @@ recv() {
age -d -i '$keypair.priv' 2>/dev/null |
base64 -d
exit 0"

# Set mark file mtime to $now (after massaging its format)
now=$(echo "$now" | rev | cut -d' ' -f2- | rev)
touch -d "$now" "$keypair.mark"
}

# genkey {{{2
Expand Down

0 comments on commit d73ca73

Please sign in to comment.