diff options
| author | 2023-04-14 19:17:16 +0200 | |
|---|---|---|
| committer | 2023-04-14 19:17:16 +0200 | |
| commit | bd21d144de18bf67facef287705e34ba030b46d8 (patch) | |
| tree | 6297a76d751bc93d3be414b473e2470c27b022e6 | |
| parent | Updated RELEASE_NOTES. (diff) | |
| download | snac2-bd21d144de18bf67facef287705e34ba030b46d8.tar.gz snac2-bd21d144de18bf67facef287705e34ba030b46d8.tar.xz snac2-bd21d144de18bf67facef287705e34ba030b46d8.zip | |
New function timeline_touch().
| -rw-r--r-- | activitypub.c | 5 | ||||
| -rw-r--r-- | data.c | 9 | ||||
| -rw-r--r-- | snac.h | 1 |
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) | |||
| 1147 | else | 1147 | else |
| 1148 | snac_debug(snac, 1, xs_fmt("process_message type '%s' ignored", type)); | 1148 | snac_debug(snac, 1, xs_fmt("process_message type '%s' ignored", type)); |
| 1149 | 1149 | ||
| 1150 | if (do_notify) | 1150 | if (do_notify) { |
| 1151 | notify(snac, type, utype, actor, msg); | 1151 | notify(snac, type, utype, actor, msg); |
| 1152 | 1152 | ||
| 1153 | timeline_touch(snac); | ||
| 1154 | } | ||
| 1155 | |||
| 1153 | return 1; | 1156 | return 1; |
| 1154 | } | 1157 | } |
| 1155 | 1158 | ||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <time.h> | 14 | #include <time.h> |
| 15 | #include <sys/stat.h> | 15 | #include <sys/stat.h> |
| 16 | #include <sys/file.h> | 16 | #include <sys/file.h> |
| 17 | #include <sys/time.h> | ||
| 17 | #include <fcntl.h> | 18 | #include <fcntl.h> |
| 18 | #include <pthread.h> | 19 | #include <pthread.h> |
| 19 | 20 | ||
| @@ -870,6 +871,14 @@ double timeline_mtime(snac *snac) | |||
| 870 | } | 871 | } |
| 871 | 872 | ||
| 872 | 873 | ||
| 874 | int timeline_touch(snac *snac) | ||
| 875 | /* changes the date of the timeline index */ | ||
| 876 | { | ||
| 877 | xs *fn = xs_fmt("%s/private.idx", snac->basedir); | ||
| 878 | return utimes(fn, NULL); | ||
| 879 | } | ||
| 880 | |||
| 881 | |||
| 873 | xs_str *timeline_fn_by_md5(snac *snac, const char *md5) | 882 | xs_str *timeline_fn_by_md5(snac *snac, const char *md5) |
| 874 | /* get the filename of an entry by md5 from any timeline */ | 883 | /* get the filename of an entry by md5 from any timeline */ |
| 875 | { | 884 | { |
| @@ -98,6 +98,7 @@ int follower_check(snac *snac, const char *actor); | |||
| 98 | d_char *follower_list(snac *snac); | 98 | d_char *follower_list(snac *snac); |
| 99 | 99 | ||
| 100 | double timeline_mtime(snac *snac); | 100 | double timeline_mtime(snac *snac); |
| 101 | int timeline_touch(snac *snac); | ||
| 101 | int timeline_here(snac *snac, const char *md5); | 102 | int timeline_here(snac *snac, const char *md5); |
| 102 | int timeline_get_by_md5(snac *snac, const char *md5, xs_dict **msg); | 103 | int timeline_get_by_md5(snac *snac, const char *md5, xs_dict **msg); |
| 103 | int timeline_del(snac *snac, char *id); | 104 | int timeline_del(snac *snac, char *id); |