diff options
author | default <nobody@localhost> | 2023-12-10 10:36:14 +0100 |
---|---|---|
committer | default <nobody@localhost> | 2023-12-10 10:36:14 +0100 |
commit | 8823325bd93afd05370ce175edde90beaaef027e (patch) | |
tree | ba625e7f1b2798d2119551dfc03955f653110f8c | |
parent | 90179f84596e7885fade4552cbeac0beb5c53303 (diff) |
The 'actor' command from the command-line allows non-signed queries.
-rw-r--r-- | main.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -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; |