diff options
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 22 |
1 files changed, 20 insertions, 2 deletions
| @@ -51,7 +51,9 @@ int usage(void) | |||
| 51 | printf("export_csv {basedir} {uid} Exports data as CSV files into current directory\n"); | 51 | printf("export_csv {basedir} {uid} Exports data as CSV files into current directory\n"); |
| 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 in the 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 | } |
| @@ -558,7 +560,11 @@ int main(int argc, char *argv[]) | |||
| 558 | if (data != NULL) { | 560 | if (data != NULL) { |
| 559 | xs_json_dump(data, 4, stdout); | 561 | xs_json_dump(data, 4, stdout); |
| 560 | enqueue_actor_refresh(&snac, xs_dict_get(data, "attributedTo"), 0); | 562 | enqueue_actor_refresh(&snac, xs_dict_get(data, "attributedTo"), 0); |
| 561 | timeline_add(&snac, url, data); | 563 | |
| 564 | if (!timeline_here(&snac, url)) | ||
| 565 | timeline_add(&snac, url, data); | ||
| 566 | else | ||
| 567 | printf("Post %s already here\n", url); | ||
| 562 | } | 568 | } |
| 563 | 569 | ||
| 564 | return 0; | 570 | return 0; |
| @@ -585,6 +591,18 @@ int main(int argc, char *argv[]) | |||
| 585 | return 0; | 591 | return 0; |
| 586 | } | 592 | } |
| 587 | 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 | |||
| 588 | if (strcmp(cmd, "note") == 0) { /** **/ | 606 | if (strcmp(cmd, "note") == 0) { /** **/ |
| 589 | xs *content = NULL; | 607 | xs *content = NULL; |
| 590 | xs *msg = NULL; | 608 | xs *msg = NULL; |