summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-06-13 20:36:43 +0200
committerdefault <nobody@localhost>2023-06-13 20:36:43 +0200
commite0c6fb786c3b72b8a789041db2909fa7d1d880de (patch)
tree40b4b9af3f6de66ffe5cf839a5e603963344a4bd /main.c
parente26d05746c8ad2ea79931f8be24536e6f8ce59a7 (diff)
New function webfinger_request_signed().
Diffstat (limited to 'main.c')
-rw-r--r--main.c49
1 files changed, 34 insertions, 15 deletions
diff --git a/main.c b/main.c
index e2de58e..97f47de 100644
--- a/main.c
+++ b/main.c
@@ -16,20 +16,21 @@ int usage(void)
printf("\n");
printf("Commands:\n");
printf("\n");
- printf("init [{basedir}] Initializes the data storage\n");
- printf("upgrade {basedir} Upgrade to a new version\n");
- printf("adduser {basedir} [{uid}] Adds a new user\n");
- printf("httpd {basedir} Starts the HTTPD daemon\n");
- printf("purge {basedir} Purges old data\n");
- printf("webfinger {basedir} {user} Queries about a @user@host or actor\n");
- printf("queue {basedir} {uid} Processes a user queue\n");
- 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("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");
+ printf("init [{basedir}] Initializes the data storage\n");
+ printf("upgrade {basedir} Upgrade to a new version\n");
+ printf("adduser {basedir} [{uid}] Adds a new user\n");
+ printf("httpd {basedir} Starts the HTTPD daemon\n");
+ printf("purge {basedir} Purges old data\n");
+ printf("webfinger {basedir} {actor} Queries about an actor (@user@host or actor url)\n");
+ printf("queue {basedir} {uid} Processes a user queue\n");
+ 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("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");
+ printf("webfinger_s {basedir} {uid} {actor} Queries about an actor (@user@host or actor url)\n");
/* printf("question {basedir} {uid} 'opts' Generates a poll (;-separated opts)\n");*/
return 1;
@@ -179,6 +180,22 @@ int main(int argc, char *argv[])
if ((url = GET_ARGV()) == NULL)
return usage();
+ if (strcmp(cmd, "webfinger_s") == 0) { /** **/
+ xs *actor = NULL;
+ xs *uid = NULL;
+ int status;
+
+ status = webfinger_request_signed(&snac, url, &actor, &uid);
+
+ printf("status: %d\n", status);
+ if (actor != NULL)
+ printf("actor: %s\n", actor);
+ if (uid != NULL)
+ printf("uid: %s\n", uid);
+
+ return 0;
+ }
+
if (strcmp(cmd, "announce") == 0) { /** **/
xs *msg = msg_admiration(&snac, url, "Announce");
@@ -352,5 +369,7 @@ int main(int argc, char *argv[])
return 0;
}
- return 0;
+ fprintf(stderr, "ERROR: bad command '%s'\n", cmd);
+
+ return 1;
}