Forráskód Böngészése

Fixed RSS and outbox to use the new data storage.

default 3 éve
szülő
commit
33c8a73c17
2 módosított fájl, 14 hozzáadás és 7 törlés
  1. 9 6
      activitypub.c
  2. 5 1
      html.c

+ 9 - 6
activitypub.c

@@ -1101,13 +1101,16 @@ int activitypub_get_handler(d_char *req, char *q_path,
 
 
         p = elems;
         p = elems;
         while (xs_list_iter(&p, &v)) {
         while (xs_list_iter(&p, &v)) {
-            xs *i = timeline_get(&snac, v);
-            char *type = xs_dict_get(i, "type");
-            char *id   = xs_dict_get(i, "id");
+            xs *i = NULL;
 
 
-            if (type && id && strcmp(type, "Note") == 0 && xs_startswith(id, snac.actor)) {
-                i = xs_dict_del(i, "_snac");
-                list = xs_list_append(list, i);
+            if (valid_status(object_get_by_md5(v, &i, NULL))) {
+                char *type = xs_dict_get(i, "type");
+                char *id   = xs_dict_get(i, "id");
+
+                if (type && id && strcmp(type, "Note") == 0 && xs_startswith(id, snac.actor)) {
+                    i = xs_dict_del(i, "_snac");
+                    list = xs_list_append(list, i);
+                }
             }
             }
         }
         }
 
 

+ 5 - 1
html.c

@@ -1131,7 +1131,11 @@ int html_get_handler(d_char *req, char *q_path, char **body, int *b_size, char *
 
 
         p = elems;
         p = elems;
         while (xs_list_iter(&p, &v)) {
         while (xs_list_iter(&p, &v)) {
-            xs *msg  = timeline_get(&snac, v);
+            xs *msg  = NULL;
+
+            if (!valid_status(object_get_by_md5(v, &msg, NULL)))
+                continue;
+
             char *id = xs_dict_get(msg, "id");
             char *id = xs_dict_get(msg, "id");
 
 
             if (!xs_startswith(id, snac.actor))
             if (!xs_startswith(id, snac.actor))