summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-04-14 19:17:16 +0200
committerdefault <nobody@localhost>2023-04-14 19:17:16 +0200
commitbd21d144de18bf67facef287705e34ba030b46d8 (patch)
tree6297a76d751bc93d3be414b473e2470c27b022e6
parent9ce6fb03edbaa069ebc42f72ac10e3d8e93b3b0e (diff)
New function timeline_touch().
-rw-r--r--activitypub.c5
-rw-r--r--data.c9
-rw-r--r--snac.h1
3 files changed, 14 insertions, 1 deletions
diff --git a/activitypub.c b/activitypub.c
index bf9ce67..98baf8b 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -1147,9 +1147,12 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
else
snac_debug(snac, 1, xs_fmt("process_message type '%s' ignored", type));
- if (do_notify)
+ if (do_notify) {
notify(snac, type, utype, actor, msg);
+ timeline_touch(snac);
+ }
+
return 1;
}
diff --git a/data.c b/data.c
index 7071097..9f2e462 100644
--- a/data.c
+++ b/data.c
@@ -14,6 +14,7 @@
#include <time.h>
#include <sys/stat.h>
#include <sys/file.h>
+#include <sys/time.h>
#include <fcntl.h>
#include <pthread.h>
@@ -870,6 +871,14 @@ double timeline_mtime(snac *snac)
}
+int timeline_touch(snac *snac)
+/* changes the date of the timeline index */
+{
+ xs *fn = xs_fmt("%s/private.idx", snac->basedir);
+ return utimes(fn, NULL);
+}
+
+
xs_str *timeline_fn_by_md5(snac *snac, const char *md5)
/* get the filename of an entry by md5 from any timeline */
{
diff --git a/snac.h b/snac.h
index f1fe13f..17bd361 100644
--- a/snac.h
+++ b/snac.h
@@ -98,6 +98,7 @@ int follower_check(snac *snac, const char *actor);
d_char *follower_list(snac *snac);
double timeline_mtime(snac *snac);
+int timeline_touch(snac *snac);
int timeline_here(snac *snac, const char *md5);
int timeline_get_by_md5(snac *snac, const char *md5, xs_dict **msg);
int timeline_del(snac *snac, char *id);