diff options
| -rw-r--r-- | main.c | 14 | ||||
| -rw-r--r-- | utils.c | 2 |
2 files changed, 15 insertions, 1 deletions
| @@ -52,6 +52,8 @@ int usage(void) | |||
| 52 | printf("alias {basedir} {uid} {account} Sets account (@user@host or actor url) as an alias\n"); | 52 | printf("alias {basedir} {uid} {account} Sets account (@user@host or actor url) as an alias\n"); |
| 53 | printf("migrate {basedir} {uid} Migrates to the account defined as the alias\n"); | 53 | printf("migrate {basedir} {uid} Migrates to the account defined as the alias\n"); |
| 54 | printf("import_csv {basedir} {uid} Imports data from CSV files into current directory\n"); | 54 | printf("import_csv {basedir} {uid} Imports data from CSV files into current directory\n"); |
| 55 | printf("import_list {basedir} {uid} {file} Imports a Mastodon CSV list file\n"); | ||
| 56 | printf("import_block_list {basedir} {uid} {file} Imports a Mastodon CSV block list file\n"); | ||
| 55 | 57 | ||
| 56 | return 1; | 58 | return 1; |
| 57 | } | 59 | } |
| @@ -589,6 +591,18 @@ int main(int argc, char *argv[]) | |||
| 589 | return 0; | 591 | return 0; |
| 590 | } | 592 | } |
| 591 | 593 | ||
| 594 | if (strcmp(cmd, "import_list") == 0) { /** **/ | ||
| 595 | import_list_csv(&snac, url); | ||
| 596 | |||
| 597 | return 0; | ||
| 598 | } | ||
| 599 | |||
| 600 | if (strcmp(cmd, "import_block_list") == 0) { /** **/ | ||
| 601 | import_blocked_accounts_csv(&snac, url); | ||
| 602 | |||
| 603 | return 0; | ||
| 604 | } | ||
| 605 | |||
| 592 | if (strcmp(cmd, "note") == 0) { /** **/ | 606 | if (strcmp(cmd, "note") == 0) { /** **/ |
| 593 | xs *content = NULL; | 607 | xs *content = NULL; |
| 594 | xs *msg = NULL; | 608 | xs *msg = NULL; |
| @@ -681,7 +681,7 @@ void import_blocked_accounts_csv(snac *user, const char *fn) | |||
| 681 | while (!feof(f)) { | 681 | while (!feof(f)) { |
| 682 | xs *l = xs_strip_i(xs_readline(f)); | 682 | xs *l = xs_strip_i(xs_readline(f)); |
| 683 | 683 | ||
| 684 | if (*l) { | 684 | if (*l && strchr(l, '@') != NULL) { |
| 685 | xs *url = NULL; | 685 | xs *url = NULL; |
| 686 | xs *uid = NULL; | 686 | xs *uid = NULL; |
| 687 | 687 | ||