diff options
| author | 2022-12-02 20:39:31 +0100 | |
|---|---|---|
| committer | 2022-12-02 20:39:31 +0100 | |
| commit | 4819c4248dc54c05cd4db9f181b333c3fd05d03d (patch) | |
| tree | a0eb8b255ddce7590213051bbe1351e084b99749 | |
| parent | The old timeline is no longer maintained. (diff) | |
| download | snac2-4819c4248dc54c05cd4db9f181b333c3fd05d03d.tar.gz snac2-4819c4248dc54c05cd4db9f181b333c3fd05d03d.tar.xz snac2-4819c4248dc54c05cd4db9f181b333c3fd05d03d.zip | |
More old code deletions.
Diffstat (limited to '')
| -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) | |||
| 791 | int timeline_del(snac *snac, char *id) | 791 | int timeline_del(snac *snac, char *id) |
| 792 | /* deletes a message from the timeline */ | 792 | /* deletes a message from the timeline */ |
| 793 | { | 793 | { |
| 794 | int ret = 404; | ||
| 795 | xs *fn = _timeline_find_fn(snac, id); | ||
| 796 | |||
| 797 | if (fn != NULL) { | ||
| 798 | xs *lfn = NULL; | ||
| 799 | |||
| 800 | unlink(fn); | ||
| 801 | snac_debug(snac, 1, xs_fmt("timeline_del %s", id)); | ||
| 802 | |||
| 803 | /* try to delete also from the local timeline */ | ||
| 804 | lfn = xs_replace(fn, "/timeline/", "/local/"); | ||
| 805 | |||
| 806 | if (unlink(lfn) != -1) | ||
| 807 | snac_debug(snac, 1, xs_fmt("timeline_del (local) %s", id)); | ||
| 808 | |||
| 809 | ret = 200; | ||
| 810 | } | ||
| 811 | |||
| 812 | /* delete from the user's caches */ | 794 | /* delete from the user's caches */ |
| 813 | object_user_cache_del(snac, id, "public"); | 795 | object_user_cache_del(snac, id, "public"); |
| 814 | object_user_cache_del(snac, id, "private"); | 796 | object_user_cache_del(snac, id, "private"); |
| 815 | 797 | ||
| 816 | /* try to delete the object if it's not used elsewhere */ | 798 | /* try to delete the object if it's not used elsewhere */ |
| 817 | object_del_if_unref(id); | 799 | return object_del_if_unref(id); |
| 818 | |||
| 819 | return ret; | ||
| 820 | } | ||
| 821 | |||
| 822 | |||
| 823 | d_char *timeline_get(snac *snac, char *fn) | ||
| 824 | /* gets a timeline entry by file name */ | ||
| 825 | { | ||
| 826 | d_char *d = NULL; | ||
| 827 | FILE *f; | ||
| 828 | |||
| 829 | if ((f = fopen(fn, "r")) != NULL) { | ||
| 830 | xs *j = xs_readall(f); | ||
| 831 | |||
| 832 | d = xs_json_loads(j); | ||
| 833 | fclose(f); | ||
| 834 | } | ||
| 835 | |||
| 836 | return d; | ||
| 837 | } | 800 | } |
| 838 | 801 | ||
| 839 | 802 | ||
| @@ -1041,8 +1041,6 @@ int html_get_handler(d_char *req, char *q_path, char **body, int *b_size, char * | |||
| 1041 | 1041 | ||
| 1042 | xs *list = timeline_list(&snac, "private", XS_ALL); | 1042 | xs *list = timeline_list(&snac, "private", XS_ALL); |
| 1043 | 1043 | ||
| 1044 | printf("--> %d\n", xs_list_len(list)); | ||
| 1045 | |||
| 1046 | *body = html_timeline(&snac, list, 0); | 1044 | *body = html_timeline(&snac, list, 0); |
| 1047 | *b_size = strlen(*body); | 1045 | *b_size = strlen(*body); |
| 1048 | status = 200; | 1046 | status = 200; |
| @@ -79,7 +79,6 @@ int timeline_here(snac *snac, char *id); | |||
| 79 | d_char *_timeline_find_fn(snac *snac, char *id); | 79 | d_char *_timeline_find_fn(snac *snac, char *id); |
| 80 | d_char *timeline_find(snac *snac, char *id); | 80 | d_char *timeline_find(snac *snac, char *id); |
| 81 | int timeline_del(snac *snac, char *id); | 81 | int timeline_del(snac *snac, char *id); |
| 82 | d_char *timeline_get(snac *snac, char *fn); | ||
| 83 | d_char *timeline_list(snac *snac, const char *idx_name, int max); | 82 | d_char *timeline_list(snac *snac, const char *idx_name, int max); |
| 84 | int timeline_add(snac *snac, char *id, char *o_msg, char *parent, char *referrer); | 83 | int timeline_add(snac *snac, char *id, char *o_msg, char *parent, char *referrer); |
| 85 | void timeline_admire(snac *snac, char *o_msg, char *id, char *admirer, int like); | 84 | void timeline_admire(snac *snac, char *o_msg, char *id, char *admirer, int like); |