summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorGravatar Oliver2025-08-23 11:04:11 +0200
committerGravatar Oliver2025-08-23 11:04:11 +0200
commite50a6ba146def4accc36d9d6cc4be43e4a758711 (patch)
tree7490d0b360b2d85e514ea9816075e661e3f98b7b /main.c
parentMerge pull request 'updates holen' (#10) from grunfink/snac2:master into master (diff)
parentAdded 'collect_replies' info in the about screen. (diff)
downloadpenes-snac2-e50a6ba146def4accc36d9d6cc4be43e4a758711.tar.gz
penes-snac2-e50a6ba146def4accc36d9d6cc4be43e4a758711.tar.xz
penes-snac2-e50a6ba146def4accc36d9d6cc4be43e4a758711.zip
Merge pull request 'master' (#11) from grunfink/snac2:master into master
Reviewed-on: https://codeberg.org/zen/snac2/pulls/11
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/main.c b/main.c
index c4c298f..e01b6a2 100644
--- a/main.c
+++ b/main.c
@@ -39,6 +39,7 @@ int usage(const char *cmd)
39 "unfollow {basedir} {uid} {actor} Unfollows an actor\n" 39 "unfollow {basedir} {uid} {actor} Unfollows an actor\n"
40 "request {basedir} {uid} {url} Requests an object\n" 40 "request {basedir} {uid} {url} Requests an object\n"
41 "insert {basedir} {uid} {url} Requests an object and inserts it into the timeline\n" 41 "insert {basedir} {uid} {url} Requests an object and inserts it into the timeline\n"
42 "collect_replies {basedir} {uid} {url} Collects all replies from a post\n"
42 "actor {basedir} [{uid}] {url} Requests an actor\n" 43 "actor {basedir} [{uid}] {url} Requests an actor\n"
43 "note {basedir} {uid} {text} [files...] Sends a note with optional attachments\n" 44 "note {basedir} {uid} {text} [files...] Sends a note with optional attachments\n"
44 "note_unlisted {basedir} {uid} {text} [files...] Sends an unlisted note with optional attachments\n" 45 "note_unlisted {basedir} {uid} {text} [files...] Sends an unlisted note with optional attachments\n"
@@ -61,7 +62,7 @@ int usage(const char *cmd)
61 "verify_links {basedir} {uid} Verifies a user's links (in the metadata)\n" 62 "verify_links {basedir} {uid} Verifies a user's links (in the metadata)\n"
62 "search {basedir} {uid} {regex} Searches posts by content\n" 63 "search {basedir} {uid} {regex} Searches posts by content\n"
63 "export_csv {basedir} {uid} Exports followers, lists, MUTEd and bookmarks to CSV\n" 64 "export_csv {basedir} {uid} Exports followers, lists, MUTEd and bookmarks to CSV\n"
64 "export_posts {basedir} {iod} Exports all posts to outbox.json\n" 65 "export_posts {basedir} {uid} Exports all posts to outbox.json\n"
65 "alias {basedir} {uid} {account} Sets account (@user@host or actor url) as an alias\n" 66 "alias {basedir} {uid} {account} Sets account (@user@host or actor url) as an alias\n"
66 "migrate {basedir} {uid} Migrates to the account defined as the alias\n" 67 "migrate {basedir} {uid} Migrates to the account defined as the alias\n"
67 "import_csv {basedir} {uid} Imports data from CSV files\n" 68 "import_csv {basedir} {uid} Imports data from CSV files\n"
@@ -494,6 +495,7 @@ int main(int argc, char *argv[])
494 495
495 if (msg != NULL) { 496 if (msg != NULL) {
496 enqueue_message(&snac, msg); 497 enqueue_message(&snac, msg);
498 timeline_admire(&snac, xs_dict_get(msg, "object"), snac.actor, 0);
497 499
498 if (dbglevel) { 500 if (dbglevel) {
499 xs_json_dump(msg, 4, stdout); 501 xs_json_dump(msg, 4, stdout);
@@ -730,6 +732,12 @@ int main(int argc, char *argv[])
730 return 0; 732 return 0;
731 } 733 }
732 734
735 if (strcmp(cmd, "collect_replies") == 0) { /** **/
736 enqueue_collect_replies(&snac, url);
737
738 return 0;
739 }
740
733 if (strcmp(cmd, "insert") == 0) { /** **/ 741 if (strcmp(cmd, "insert") == 0) { /** **/
734 int status; 742 int status;
735 xs *data = NULL; 743 xs *data = NULL;