diff options
author | default <nobody@localhost> | 2022-12-02 20:39:31 +0100 |
---|---|---|
committer | default <nobody@localhost> | 2022-12-02 20:39:31 +0100 |
commit | 4819c4248dc54c05cd4db9f181b333c3fd05d03d (patch) | |
tree | a0eb8b255ddce7590213051bbe1351e084b99749 | |
parent | 67d57252ea094491420f20de244b74ff112382f2 (diff) |
More old code deletions.
-rw-r--r-- | data.c | 39 | ||||
-rw-r--r-- | html.c | 2 | ||||
-rw-r--r-- | snac.h | 1 |
3 files changed, 1 insertions, 41 deletions
@@ -791,49 +791,12 @@ d_char *timeline_find(snac *snac, char *id) int timeline_del(snac *snac, char *id) /* deletes a message from the timeline */ { - int ret = 404; - xs *fn = _timeline_find_fn(snac, id); - - if (fn != NULL) { - xs *lfn = NULL; - - unlink(fn); - snac_debug(snac, 1, xs_fmt("timeline_del %s", id)); - - /* try to delete also from the local timeline */ - lfn = xs_replace(fn, "/timeline/", "/local/"); - - if (unlink(lfn) != -1) - snac_debug(snac, 1, xs_fmt("timeline_del (local) %s", id)); - - ret = 200; - } - /* delete from the user's caches */ object_user_cache_del(snac, id, "public"); object_user_cache_del(snac, id, "private"); /* try to delete the object if it's not used elsewhere */ - object_del_if_unref(id); - - return ret; -} - - -d_char *timeline_get(snac *snac, char *fn) -/* gets a timeline entry by file name */ -{ - d_char *d = NULL; - FILE *f; - - if ((f = fopen(fn, "r")) != NULL) { - xs *j = xs_readall(f); - - d = xs_json_loads(j); - fclose(f); - } - - return d; + return object_del_if_unref(id); } @@ -1041,8 +1041,6 @@ int html_get_handler(d_char *req, char *q_path, char **body, int *b_size, char * xs *list = timeline_list(&snac, "private", XS_ALL); - printf("--> %d\n", xs_list_len(list)); - *body = html_timeline(&snac, list, 0); *b_size = strlen(*body); status = 200; @@ -79,7 +79,6 @@ int timeline_here(snac *snac, char *id); d_char *_timeline_find_fn(snac *snac, char *id); d_char *timeline_find(snac *snac, char *id); int timeline_del(snac *snac, char *id); -d_char *timeline_get(snac *snac, char *fn); d_char *timeline_list(snac *snac, const char *idx_name, int max); int timeline_add(snac *snac, char *id, char *o_msg, char *parent, char *referrer); void timeline_admire(snac *snac, char *o_msg, char *id, char *admirer, int like); |