summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/utils.c b/utils.c
index e6d14d0..4f5ac55 100644
--- a/utils.c
+++ b/utils.c
@@ -766,6 +766,26 @@ void import_csv(snac *user)
766 xs *l = xs_strip_i(xs_readline(f)); 766 xs *l = xs_strip_i(xs_readline(f));
767 767
768 if (*l) { 768 if (*l) {
769 xs *l2 = xs_split(l, ",");
770 const char *lname = xs_list_get(l2, 0);
771 const char *acct = xs_list_get(l2, 1);
772
773 if (lname && acct) {
774 /* create the list */
775 xs *list_id = list_maint(user, lname, 1);
776
777 xs *url = NULL;
778 xs *uid = NULL;
779
780 if (valid_status(webfinger_request(acct, &url, &uid))) {
781 xs *actor_md5 = xs_md5_hex(url, strlen(url));
782
783 list_content(user, list_id, actor_md5, 1);
784 snac_log(user, xs_fmt("Added %s to list %s", url, lname));
785 }
786 else
787 snac_log(user, xs_fmt("Webfinger error while adding %s to list %s", acct, lname));
788 }
769 } 789 }
770 } 790 }
771 791