commit 12aedfa
default
·
2023-02-05 12:35:50 +0000 UTC
parent 8983eb1
New function timeline_get().
M
data.c
+7,
-0
1@@ -824,6 +824,13 @@ double timeline_mtime(snac *snac)
2 }
3
4
5+int timeline_get(snac *snac, const char *id, xs_dict **msg)
6+/* gets a message from the timeline */
7+{
8+ return object_get_by_md5(id, msg, NULL);
9+}
10+
11+
12 int timeline_del(snac *snac, char *id)
13 /* deletes a message from the timeline */
14 {
M
html.c
+1,
-1
1@@ -1256,7 +1256,7 @@ int html_get_handler(d_char *req, char *q_path, char **body, int *b_size, char *
2 while (xs_list_iter(&p, &v)) {
3 xs *msg = NULL;
4
5- if (!valid_status(object_get_by_md5(v, &msg, NULL)))
6+ if (!valid_status(timeline_get(&snac, v, &msg)))
7 continue;
8
9 char *id = xs_dict_get(msg, "id");
M
snac.h
+1,
-0
1@@ -88,6 +88,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_get(snac *snac, const char *id, xs_dict **msg);
6 int timeline_del(snac *snac, char *id);
7 d_char *timeline_simple_list(snac *snac, const char *idx_name, int skip, int show);
8 d_char *timeline_list(snac *snac, const char *idx_name, int skip, int show);