aboutsummaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
Diffstat (limited to 'data.c')
-rw-r--r--data.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/data.c b/data.c
index 480a35b..7139cdf 100644
--- a/data.c
+++ b/data.c
@@ -1532,7 +1532,23 @@ void timeline_add_mark(snac *user)
/* adds an "already seen" mark to the private timeline */
{
xs *fn = xs_fmt("%s/private.idx", user->basedir);
- index_add_md5(fn, MD5_ALREADY_SEEN_MARK);
+ char last_entry[MD5_HEX_SIZE] = "";
+ FILE *f;
+
+ /* get the last entry in the index */
+ if ((f = fopen(fn, "r")) != NULL) {
+ index_desc_first(f, last_entry, 0);
+ fclose(f);
+ }
+
+ /* is the last entry *not* a mark? */
+ if (strcmp(last_entry, MD5_ALREADY_SEEN_MARK) != 0) {
+ /* add it */
+ index_add_md5(fn, MD5_ALREADY_SEEN_MARK);
+
+ /* mark as new */
+ timeline_touch(user);
+ }
}