mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 13:25:04 +00:00
Added command-line interface for [un]blocking full instances.
This commit is contained in:
parent
61957a86da
commit
057827eaa3
1 changed files with 25 additions and 0 deletions
25
main.c
25
main.c
|
@ -33,6 +33,9 @@ int usage(void)
|
||||||
printf("webfinger_s {basedir} {uid} {actor} Queries about an actor (@user@host or actor url)\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("pin {basedir} {uid} {msg_url} Pins a message\n");
|
||||||
printf("unpin {basedir} {uid} {msg_url} Unpins a message\n");
|
printf("unpin {basedir} {uid} {msg_url} Unpins a message\n");
|
||||||
|
printf("block {basedir} {instance_url} Blocks a full instance\n");
|
||||||
|
printf("unblock {basedir} {instance_url} Unblocks a full instance\n");
|
||||||
|
|
||||||
/* printf("question {basedir} {uid} 'opts' Generates a poll (;-separated opts)\n");*/
|
/* printf("question {basedir} {uid} 'opts' Generates a poll (;-separated opts)\n");*/
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -127,6 +130,28 @@ int main(int argc, char *argv[])
|
||||||
if ((user = GET_ARGV()) == NULL)
|
if ((user = GET_ARGV()) == NULL)
|
||||||
return usage();
|
return usage();
|
||||||
|
|
||||||
|
if (strcmp(cmd, "block") == 0) { /** **/
|
||||||
|
int ret = instance_block(user);
|
||||||
|
|
||||||
|
if (ret < 0) {
|
||||||
|
fprintf(stderr, "Error blocking instance %s: %d\n", user, ret);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strcmp(cmd, "unblock") == 0) { /** **/
|
||||||
|
int ret = instance_unblock(user);
|
||||||
|
|
||||||
|
if (ret < 0) {
|
||||||
|
fprintf(stderr, "Error unblocking instance %s: %d\n", user, ret);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (strcmp(cmd, "webfinger") == 0) { /** **/
|
if (strcmp(cmd, "webfinger") == 0) { /** **/
|
||||||
xs *actor = NULL;
|
xs *actor = NULL;
|
||||||
xs *uid = NULL;
|
xs *uid = NULL;
|
||||||
|
|
Loading…
Reference in a new issue