diff options
author | default <nobody@localhost> | 2023-06-28 20:52:09 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2023-06-28 20:52:09 +0200 |
commit | af180685bdb430e90e3c4057c87595520ee385b4 (patch) | |
tree | 65db25c5b4d5f273224a61109e18554ede0997d2 /main.c | |
parent | 394240b9ba6393794cffd7affa3a5cc6075774aa (diff) |
Added some error control to pinning.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -31,6 +31,8 @@ int usage(void) 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("pin {basedir} {uid} {msg_url} Pins a message\n"); + printf("unpin {basedir} {uid} {msg_url} Unpins a message\n"); /* printf("question {basedir} {uid} 'opts' Generates a poll (;-separated opts)\n");*/ return 1; @@ -269,6 +271,26 @@ int main(int argc, char *argv[]) return 0; } + if (strcmp(cmd, "pin") == 0) { /** **/ + int ret = pin(&snac, url); + if (ret < 0) { + fprintf(stderr, "error pinning %s %d\n", url, ret); + return 1; + } + + return 0; + } + + if (strcmp(cmd, "unpin") == 0) { /** **/ + int ret = unpin(&snac, url); + if (ret < 0) { + fprintf(stderr, "error unpinning %s %d\n", url, ret); + return 1; + } + + return 0; + } + if (strcmp(cmd, "question") == 0) { /** **/ int end_secs = 5 * 60; xs *opts = xs_split(url, ";"); |