diff options
author | default <nobody@localhost> | 2023-05-05 09:54:41 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2023-05-05 09:54:41 +0200 |
commit | d3a36218a6ebfc951ff38c410ac1c29ec15c3c7f (patch) | |
tree | 029f4a81193e739d8254db83699349a4983a9983 /main.c | |
parent | cd71bd08bffc58f01610f3c13ff00c7ec214fd6a (diff) |
Implemented 'Ping' and 'Pong' activities.
According to https://humungus.tedunangst.com/r/honk/v/tip/f/docs/ping.txt
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -30,6 +30,7 @@ int usage(void) 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"); return 1; } @@ -228,6 +229,19 @@ int main(int argc, char *argv[]) return 0; } + if (strcmp(cmd, "ping") == 0) { + xs *msg = msg_ping(&snac, url); + + enqueue_output_by_actor(&snac, msg, url, 0); + + if (dbglevel) { + xs *j = xs_json_dumps_pp(msg, 4); + printf("%s\n", msg); + } + + return 0; + } + if (strcmp(cmd, "request") == 0) { int status; xs *data = NULL; |