summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-06-28 20:52:09 +0200
committerdefault <nobody@localhost>2023-06-28 20:52:09 +0200
commitaf180685bdb430e90e3c4057c87595520ee385b4 (patch)
tree65db25c5b4d5f273224a61109e18554ede0997d2 /main.c
parent394240b9ba6393794cffd7affa3a5cc6075774aa (diff)
Added some error control to pinning.
Diffstat (limited to 'main.c')
-rw-r--r--main.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/main.c b/main.c
index 97f47de..f33ad2f 100644
--- a/main.c
+++ b/main.c
@@ -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, ";");