diff options
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 49 |
1 files changed, 34 insertions, 15 deletions
| @@ -16,20 +16,21 @@ int usage(void) | |||
| 16 | printf("\n"); | 16 | printf("\n"); |
| 17 | printf("Commands:\n"); | 17 | printf("Commands:\n"); |
| 18 | printf("\n"); | 18 | printf("\n"); |
| 19 | printf("init [{basedir}] Initializes the data storage\n"); | 19 | printf("init [{basedir}] Initializes the data storage\n"); |
| 20 | printf("upgrade {basedir} Upgrade to a new version\n"); | 20 | printf("upgrade {basedir} Upgrade to a new version\n"); |
| 21 | printf("adduser {basedir} [{uid}] Adds a new user\n"); | 21 | printf("adduser {basedir} [{uid}] Adds a new user\n"); |
| 22 | printf("httpd {basedir} Starts the HTTPD daemon\n"); | 22 | printf("httpd {basedir} Starts the HTTPD daemon\n"); |
| 23 | printf("purge {basedir} Purges old data\n"); | 23 | printf("purge {basedir} Purges old data\n"); |
| 24 | printf("webfinger {basedir} {user} Queries about a @user@host or actor\n"); | 24 | printf("webfinger {basedir} {actor} Queries about an actor (@user@host or actor url)\n"); |
| 25 | printf("queue {basedir} {uid} Processes a user queue\n"); | 25 | printf("queue {basedir} {uid} Processes a user queue\n"); |
| 26 | printf("follow {basedir} {uid} {actor} Follows an actor\n"); | 26 | printf("follow {basedir} {uid} {actor} Follows an actor\n"); |
| 27 | printf("unfollow {basedir} {uid} {actor} Unfollows an actor\n"); | 27 | printf("unfollow {basedir} {uid} {actor} Unfollows an actor\n"); |
| 28 | printf("request {basedir} {uid} {url} Requests an object\n"); | 28 | printf("request {basedir} {uid} {url} Requests an object\n"); |
| 29 | printf("actor {basedir} {uid} {url} Requests an actor\n"); | 29 | printf("actor {basedir} {uid} {url} Requests an actor\n"); |
| 30 | printf("note {basedir} {uid} {'text'} Sends a note to followers\n"); | 30 | printf("note {basedir} {uid} {'text'} Sends a note to followers\n"); |
| 31 | printf("resetpwd {basedir} {uid} Resets the password of a user\n"); | 31 | printf("resetpwd {basedir} {uid} Resets the password of a user\n"); |
| 32 | printf("ping {basedir} {uid} {actor} Pings an actor\n"); | 32 | printf("ping {basedir} {uid} {actor} Pings an actor\n"); |
| 33 | printf("webfinger_s {basedir} {uid} {actor} Queries about an actor (@user@host or actor url)\n"); | ||
| 33 | /* printf("question {basedir} {uid} 'opts' Generates a poll (;-separated opts)\n");*/ | 34 | /* printf("question {basedir} {uid} 'opts' Generates a poll (;-separated opts)\n");*/ |
| 34 | 35 | ||
| 35 | return 1; | 36 | return 1; |
| @@ -179,6 +180,22 @@ int main(int argc, char *argv[]) | |||
| 179 | if ((url = GET_ARGV()) == NULL) | 180 | if ((url = GET_ARGV()) == NULL) |
| 180 | return usage(); | 181 | return usage(); |
| 181 | 182 | ||
| 183 | if (strcmp(cmd, "webfinger_s") == 0) { /** **/ | ||
| 184 | xs *actor = NULL; | ||
| 185 | xs *uid = NULL; | ||
| 186 | int status; | ||
| 187 | |||
| 188 | status = webfinger_request_signed(&snac, url, &actor, &uid); | ||
| 189 | |||
| 190 | printf("status: %d\n", status); | ||
| 191 | if (actor != NULL) | ||
| 192 | printf("actor: %s\n", actor); | ||
| 193 | if (uid != NULL) | ||
| 194 | printf("uid: %s\n", uid); | ||
| 195 | |||
| 196 | return 0; | ||
| 197 | } | ||
| 198 | |||
| 182 | if (strcmp(cmd, "announce") == 0) { /** **/ | 199 | if (strcmp(cmd, "announce") == 0) { /** **/ |
| 183 | xs *msg = msg_admiration(&snac, url, "Announce"); | 200 | xs *msg = msg_admiration(&snac, url, "Announce"); |
| 184 | 201 | ||
| @@ -352,5 +369,7 @@ int main(int argc, char *argv[]) | |||
| 352 | return 0; | 369 | return 0; |
| 353 | } | 370 | } |
| 354 | 371 | ||
| 355 | return 0; | 372 | fprintf(stderr, "ERROR: bad command '%s'\n", cmd); |
| 373 | |||
| 374 | return 1; | ||
| 356 | } | 375 | } |