commit bd21d14
default
·
2023-04-14 17:17:16 +0000 UTC
parent 9ce6fb0
New function timeline_touch().
3 files changed,
+14,
-1
+4,
-1
1@@ -1147,9 +1147,12 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
2 else
3 snac_debug(snac, 1, xs_fmt("process_message type '%s' ignored", type));
4
5- if (do_notify)
6+ if (do_notify) {
7 notify(snac, type, utype, actor, msg);
8
9+ timeline_touch(snac);
10+ }
11+
12 return 1;
13 }
14
M
data.c
+9,
-0
1@@ -14,6 +14,7 @@
2 #include <time.h>
3 #include <sys/stat.h>
4 #include <sys/file.h>
5+#include <sys/time.h>
6 #include <fcntl.h>
7 #include <pthread.h>
8
9@@ -870,6 +871,14 @@ double timeline_mtime(snac *snac)
10 }
11
12
13+int timeline_touch(snac *snac)
14+/* changes the date of the timeline index */
15+{
16+ xs *fn = xs_fmt("%s/private.idx", snac->basedir);
17+ return utimes(fn, NULL);
18+}
19+
20+
21 xs_str *timeline_fn_by_md5(snac *snac, const char *md5)
22 /* get the filename of an entry by md5 from any timeline */
23 {
M
snac.h
+1,
-0
1@@ -98,6 +98,7 @@ int follower_check(snac *snac, const char *actor);
2 d_char *follower_list(snac *snac);
3
4 double timeline_mtime(snac *snac);
5+int timeline_touch(snac *snac);
6 int timeline_here(snac *snac, const char *md5);
7 int timeline_get_by_md5(snac *snac, const char *md5, xs_dict **msg);
8 int timeline_del(snac *snac, char *id);