summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authorGravatar default2022-12-02 20:39:31 +0100
committerGravatar default2022-12-02 20:39:31 +0100
commit4819c4248dc54c05cd4db9f181b333c3fd05d03d (patch)
treea0eb8b255ddce7590213051bbe1351e084b99749 /data.c
parentThe old timeline is no longer maintained. (diff)
downloadsnac2-4819c4248dc54c05cd4db9f181b333c3fd05d03d.tar.gz
snac2-4819c4248dc54c05cd4db9f181b333c3fd05d03d.tar.xz
snac2-4819c4248dc54c05cd4db9f181b333c3fd05d03d.zip
More old code deletions.
Diffstat (limited to 'data.c')
-rw-r--r--data.c39
1 files changed, 1 insertions, 38 deletions
diff --git a/data.c b/data.c
index 7b3c56f..ecba921 100644
--- a/data.c
+++ b/data.c
@@ -791,49 +791,12 @@ d_char *timeline_find(snac *snac, char *id)
791int timeline_del(snac *snac, char *id) 791int 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
823d_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