diff options
| -rw-r--r-- | data.c | 18 | ||||
| -rw-r--r-- | html.c | 4 |
2 files changed, 19 insertions, 3 deletions
| @@ -1532,7 +1532,23 @@ void timeline_add_mark(snac *user) | |||
| 1532 | /* adds an "already seen" mark to the private timeline */ | 1532 | /* adds an "already seen" mark to the private timeline */ |
| 1533 | { | 1533 | { |
| 1534 | xs *fn = xs_fmt("%s/private.idx", user->basedir); | 1534 | xs *fn = xs_fmt("%s/private.idx", user->basedir); |
| 1535 | index_add_md5(fn, MD5_ALREADY_SEEN_MARK); | 1535 | char last_entry[MD5_HEX_SIZE] = ""; |
| 1536 | FILE *f; | ||
| 1537 | |||
| 1538 | /* get the last entry in the index */ | ||
| 1539 | if ((f = fopen(fn, "r")) != NULL) { | ||
| 1540 | index_desc_first(f, last_entry, 0); | ||
| 1541 | fclose(f); | ||
| 1542 | } | ||
| 1543 | |||
| 1544 | /* is the last entry *not* a mark? */ | ||
| 1545 | if (strcmp(last_entry, MD5_ALREADY_SEEN_MARK) != 0) { | ||
| 1546 | /* add it */ | ||
| 1547 | index_add_md5(fn, MD5_ALREADY_SEEN_MARK); | ||
| 1548 | |||
| 1549 | /* mark as new */ | ||
| 1550 | timeline_touch(user); | ||
| 1551 | } | ||
| 1536 | } | 1552 | } |
| 1537 | 1553 | ||
| 1538 | 1554 | ||
| @@ -2657,7 +2657,7 @@ xs_str *html_timeline(snac *user, const xs_list *list, int read_only, | |||
| 2657 | /* "already seen" mark? */ | 2657 | /* "already seen" mark? */ |
| 2658 | if (strcmp(v, MD5_ALREADY_SEEN_MARK) == 0) { | 2658 | if (strcmp(v, MD5_ALREADY_SEEN_MARK) == 0) { |
| 2659 | if (skip == 0 && !mark_shown) { | 2659 | if (skip == 0 && !mark_shown) { |
| 2660 | xs *s = xs_fmt("%s/admin#top", user->actor); | 2660 | xs *s = xs_fmt("%s/admin", user->actor); |
| 2661 | 2661 | ||
| 2662 | xs_html_add(posts, | 2662 | xs_html_add(posts, |
| 2663 | xs_html_tag("div", | 2663 | xs_html_tag("div", |
| @@ -2665,7 +2665,7 @@ xs_str *html_timeline(snac *user, const xs_list *list, int read_only, | |||
| 2665 | xs_html_text(L("No more unseen posts")), | 2665 | xs_html_text(L("No more unseen posts")), |
| 2666 | xs_html_text(" - "), | 2666 | xs_html_text(" - "), |
| 2667 | xs_html_tag("a", | 2667 | xs_html_tag("a", |
| 2668 | xs_html_attr("href", s), | 2668 | xs_html_attr("href", s), |
| 2669 | xs_html_text(L("Back to top"))))); | 2669 | xs_html_text(L("Back to top"))))); |
| 2670 | } | 2670 | } |
| 2671 | 2671 | ||