commit 8823325bd93afd05370ce175edde90beaaef027e
parent 90179f84596e7885fade4552cbeac0beb5c53303
Author: default <nobody@localhost>
Date: Sun, 10 Dec 2023 10:36:14 +0100
The 'actor' command from the command-line allows non-signed queries.
Diffstat:
M | main.c | | | 18 | +++++++++++++++++- |
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/main.c b/main.c
@@ -27,7 +27,7 @@ int usage(void)
printf("follow {basedir} {uid} {actor} Follows an actor\n");
printf("unfollow {basedir} {uid} {actor} Unfollows an actor\n");
printf("request {basedir} {uid} {url} Requests an object\n");
- printf("actor {basedir} {uid} {url} Requests an actor\n");
+ printf("actor {basedir} [{uid}] {url} Requests an actor\n");
printf("note {basedir} {uid} {'text'} Sends a note to followers\n");
printf("resetpwd {basedir} {uid} Resets the password of a user\n");
printf("ping {basedir} {uid} {actor} Pings an actor\n");
@@ -179,6 +179,22 @@ int main(int argc, char *argv[])
return 0;
}
+ if (argi == argc && strcmp(cmd, "actor") == 0) { /** **/
+ /* query an actor without user (non-signed) */
+ xs *actor = NULL;
+ int status;
+
+ status = actor_request(NULL, user, &actor);
+
+ printf("status: %d\n", status);
+ if (valid_status(status)) {
+ xs_json_dump(actor, 4, stdout);
+ printf("\n");
+ }
+
+ return 0;
+ }
+
if (!user_open(&snac, user)) {
printf("invalid user '%s'\n", user);
return 1;