commit e926fa2

default  ·  2023-06-07 09:39:13 +0000 UTC
parent f90d4b2
Changed timeline_request_replies() to receive an id and not an object.
1 files changed,  +9, -5
+9, -5
 1@@ -143,7 +143,7 @@ int actor_request(snac *snac, const char *actor, xs_dict **data)
 2 }
 3 
 4 
 5-void timeline_request_replies(snac *user, const xs_dict *msg);
 6+void timeline_request_replies(snac *user, const char *id);
 7 
 8 int timeline_request(snac *snac, char **id, xs_str **wrk)
 9 /* ensures that an entry and its ancestors are in the timeline */
10@@ -191,18 +191,22 @@ int timeline_request(snac *snac, char **id, xs_str **wrk)
11             }
12         }
13 
14-        if (object)
15-            timeline_request_replies(snac, object);
16+        timeline_request_replies(snac, *id);
17     }
18 
19     return status;
20 }
21 
22 
23-void timeline_request_replies(snac *user, const xs_dict *msg)
24+void timeline_request_replies(snac *user, const char *id)
25 /* requests all replies of a message */
26 /* FIXME: experimental -- needs more testing */
27 {
28+    xs *msg = NULL;
29+
30+    if (!valid_status(object_get(id, &msg)))
31+        return;
32+
33     /* does it have a replies collection? */
34     const xs_dict *replies = xs_dict_get(msg, "replies");
35 
36@@ -247,7 +251,7 @@ void timeline_request_replies(snac *user, const xs_dict *msg)
37                     }
38                 }
39                 else
40-                    snac_debug(user, 0, xs_fmt("reply collection get %s %d", next, status));
41+                    snac_debug(user, 0, xs_fmt("replies request error %s %d", next, status));
42             }
43         }
44     }