summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--utils.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/utils.c b/utils.c
index 5957bec..e6d14d0 100644
--- a/utils.c
+++ b/utils.c
@@ -745,6 +745,10 @@ void import_csv(snac *user)
745 limit(user, actor); 745 limit(user, actor);
746 snac_log(user, xs_fmt("Limiting boosts from actor %s", actor)); 746 snac_log(user, xs_fmt("Limiting boosts from actor %s", actor));
747 } 747 }
748 else {
749 unlimit(user, actor);
750 snac_log(user, xs_fmt("Unlimiting boosts from actor %s", actor));
751 }
748 } 752 }
749 } 753 }
750 } 754 }
@@ -778,6 +782,30 @@ void import_csv(snac *user)
778 xs *l = xs_strip_i(xs_readline(f)); 782 xs *l = xs_strip_i(xs_readline(f));
779 783
780 if (*l) { 784 if (*l) {
785 xs *post = NULL;
786
787 if (!object_get(l, &post)) {
788 if (!valid_status(activitypub_request(user, l, &post))) {
789 snac_log(user, xs_fmt("Error getting object %s for bookmarking", l));
790 continue;
791 }
792 }
793
794 if (post == NULL)
795 continue;
796
797 /* request the actor that created the post */
798 const char *actor = get_atto(post);
799
800 if (xs_type(actor) == XSTYPE_STRING)
801 actor_request(user, actor, NULL);
802
803 object_add_ow(l, post);
804 timeline_add(user, l, post);
805
806 bookmark(user, l);
807
808 snac_log(user, xs_fmt("Bookmarked %s", l));
781 } 809 }
782 } 810 }
783 811
@@ -785,5 +813,4 @@ void import_csv(snac *user)
785 } 813 }
786 else 814 else
787 snac_log(user, xs_fmt("Cannot open file %s", fn)); 815 snac_log(user, xs_fmt("Cannot open file %s", fn));
788
789} 816}