Browse Source

New function timeline_get().

default 3 năm trước cách đây
mục cha
commit
12aedfadfd
3 tập tin đã thay đổi với 9 bổ sung1 xóa
  1. 7 0
      data.c
  2. 1 1
      html.c
  3. 1 0
      snac.h

+ 7 - 0
data.c

@@ -824,6 +824,13 @@ double timeline_mtime(snac *snac)
 }
 
 
+int timeline_get(snac *snac, const char *id, xs_dict **msg)
+/* gets a message from the timeline */
+{
+    return object_get_by_md5(id, msg, NULL);
+}
+
+
 int timeline_del(snac *snac, char *id)
 /* deletes a message from the timeline */
 {

+ 1 - 1
html.c

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

+ 1 - 0
snac.h

@@ -88,6 +88,7 @@ int follower_check(snac *snac, const char *actor);
 d_char *follower_list(snac *snac);
 
 double timeline_mtime(snac *snac);
+int timeline_get(snac *snac, const char *id, xs_dict **msg);
 int timeline_del(snac *snac, char *id);
 d_char *timeline_simple_list(snac *snac, const char *idx_name, int skip, int show);
 d_char *timeline_list(snac *snac, const char *idx_name, int skip, int show);