diff options
| author | 2024-08-29 07:08:26 +0200 | |
|---|---|---|
| committer | 2024-08-29 07:08:26 +0200 | |
| commit | 1022f6db87ea196630972123601639beb190b4c3 (patch) | |
| tree | e995c3fe584ef2ee99d5140556657f2aa2a94b62 /main.c | |
| parent | Simplified pinning functions. (diff) | |
| download | penes-snac2-1022f6db87ea196630972123601639beb190b4c3.tar.gz penes-snac2-1022f6db87ea196630972123601639beb190b4c3.tar.xz penes-snac2-1022f6db87ea196630972123601639beb190b4c3.zip | |
Bookmarking can be done from the command line.
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 22 |
1 files changed, 22 insertions, 0 deletions
| @@ -39,6 +39,8 @@ int usage(void) | |||
| 39 | printf("webfinger_s {basedir} {uid} {actor} Queries about an actor (@user@host or actor url)\n"); | 39 | printf("webfinger_s {basedir} {uid} {actor} Queries about an actor (@user@host or actor url)\n"); |
| 40 | printf("pin {basedir} {uid} {msg_url} Pins a message\n"); | 40 | printf("pin {basedir} {uid} {msg_url} Pins a message\n"); |
| 41 | printf("unpin {basedir} {uid} {msg_url} Unpins a message\n"); | 41 | printf("unpin {basedir} {uid} {msg_url} Unpins a message\n"); |
| 42 | printf("bookmark {basedir} {uid} {msg_url} Bookmarks a message\n"); | ||
| 43 | printf("unbookmark {basedir} {uid} {msg_url} Unbookmarks a message\n"); | ||
| 42 | printf("block {basedir} {instance_url} Blocks a full instance\n"); | 44 | printf("block {basedir} {instance_url} Blocks a full instance\n"); |
| 43 | printf("unblock {basedir} {instance_url} Unblocks a full instance\n"); | 45 | printf("unblock {basedir} {instance_url} Unblocks a full instance\n"); |
| 44 | printf("limit {basedir} {uid} {actor} Limits an actor (drops their announces)\n"); | 46 | printf("limit {basedir} {uid} {actor} Limits an actor (drops their announces)\n"); |
| @@ -442,6 +444,26 @@ int main(int argc, char *argv[]) | |||
| 442 | return 0; | 444 | return 0; |
| 443 | } | 445 | } |
| 444 | 446 | ||
| 447 | if (strcmp(cmd, "bookmark") == 0) { /** **/ | ||
| 448 | int ret = bookmark(&snac, url); | ||
| 449 | if (ret < 0) { | ||
| 450 | fprintf(stderr, "error bookmarking %s %d\n", url, ret); | ||
| 451 | return 1; | ||
| 452 | } | ||
| 453 | |||
| 454 | return 0; | ||
| 455 | } | ||
| 456 | |||
| 457 | if (strcmp(cmd, "unbookmark") == 0) { /** **/ | ||
| 458 | int ret = unbookmark(&snac, url); | ||
| 459 | if (ret < 0) { | ||
| 460 | fprintf(stderr, "error unbookmarking %s %d\n", url, ret); | ||
| 461 | return 1; | ||
| 462 | } | ||
| 463 | |||
| 464 | return 0; | ||
| 465 | } | ||
| 466 | |||
| 445 | if (strcmp(cmd, "question") == 0) { /** **/ | 467 | if (strcmp(cmd, "question") == 0) { /** **/ |
| 446 | int end_secs = 5 * 60; | 468 | int end_secs = 5 * 60; |
| 447 | xs *opts = xs_split(url, ";"); | 469 | xs *opts = xs_split(url, ";"); |