From: Philipp Takacs Date: Sun, 15 Dec 2019 13:44:57 +0000 (+0100) Subject: update unseen sequence after display X-Git-Url: http://git.marmaro.de/?p=mmh;a=commitdiff_plain;h=9e6f6b822a6de620c0aab4b122937e2c598169ed update unseen sequence after display before this patch, if messages are displaied with a pager and during that time a new message comes to the folder. The new message is added to the unseen sequence. But after closing the pager the unseen sequence gets overwritten and the new message is removed from the unseen sequence. Now the sequence file gets reread before remove the shown messages from the unseen sequenece. --- diff --git a/test/common.sh b/test/common.sh index b869d56..9e6cb22 100644 --- a/test/common.sh +++ b/test/common.sh @@ -8,6 +8,17 @@ trap ' ' 0 1 2 15 failed=0 +#fake sleeps 60 secounds and then reads all input +mmh_test_fakepager() +{ + sleep 60 + + while read a + do + sleep 0 + done + exit 0 +} test_skip() { diff --git a/test/tests/show/test-unseen-update b/test/tests/show/test-unseen-update new file mode 100644 index 0000000..a4875c4 --- /dev/null +++ b/test/tests/show/test-unseen-update @@ -0,0 +1,46 @@ +#!/bin/sh +###################################################### +# +# Test change of sequence during show +# +###################################################### + +. "$MH_TEST_COMMON" + +mark -sequence u -add -nozero 1-9 +show 1-8 | mmh_test_fakepager & +pagerpid=$! + +#because the fakepager sleeps 60 secounds the unseen sequence should be unchainged +#this can fail if the buffer of the pipe is big enouth to hold all messages +runandcheck "pick u" <numsel + 1, sizeof(*cts)); ctp = cts; @@ -363,6 +361,8 @@ main(int argc, char **argv) /* If reading from a folder, do some updating */ if (mp) { + seq_read(mp); + seq_setunseen(mp, 0); /* unset unseen seqs for shown msgs */ context_replace(curfolder, folder); /* update current folder */ seq_setcur(mp, mp->hghsel); /* update current message */ seq_save(mp); /* synchronize sequences */