Rename mute to delay

This commit is contained in:
Felix Van der Jeugt 2020-01-06 21:19:58 +01:00
parent b2a8a2e648
commit 9b6c220917
No known key found for this signature in database
GPG key ID: 58B209295023754D
3 changed files with 27 additions and 27 deletions

View file

@ -50,9 +50,9 @@ for mid in $(notmuch search --output=messages tag:new); do
done
done
# Unmute threads with new messages
for mutetag in $(notmuch search --output=tags -- tag:muted and thread:{tag:new} | grep 'muted/'); do
notmuch tag -muted -"$mutetag" +inbox -- tag:"$mutetag" and thread:{tag:new}
# Undelay threads with new messages
for delaytag in $(notmuch search --output=tags -- tag:delay and thread:{tag:new} | grep 'delay/'); do
notmuch tag -delay -"$delaytag" +inbox -- tag:"$delaytag" and thread:{tag:new}
done
# Github notifications
@ -76,11 +76,11 @@ archive tag:github thread:{from:dependabot} \
addtag inbox "not tag:spam"
notmuch tag -new -- tag:new
# Unmute threads on their day of unmuting
# Show threads after their delay
today="$(date +'%s')"
for mutetag in $(notmuch search --output=tags tag:muted | grep 'muted/'); do
until="$(date -d "${mutetag#*/}" +'%s')"
for delaytag in $(notmuch search --output=tags tag:delay | grep 'delay/'); do
until="$(date -d "${delaytag#*/}" +'%s')"
if [ "$today" -gt "$until" ]; then
notmuch tag -muted -"$mutetag" +inbox -- tag:"$mutetag"
notmuch tag -delay -"$delay" +inbox -- tag:"$delay"
fi
done