summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c22
-rw-r--r--snac.h4
2 files changed, 26 insertions, 0 deletions
diff --git a/main.c b/main.c
index c88eebe..62d6484 100644
--- a/main.c
+++ b/main.c
@@ -39,6 +39,8 @@ int usage(void)
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("bookmark {basedir} {uid} {msg_url} Bookmarks a message\n");
+ printf("unbookmark {basedir} {uid} {msg_url} Unbookmarks a message\n");
printf("block {basedir} {instance_url} Blocks a full instance\n");
printf("unblock {basedir} {instance_url} Unblocks a full instance\n");
printf("limit {basedir} {uid} {actor} Limits an actor (drops their announces)\n");
@@ -442,6 +444,26 @@ int main(int argc, char *argv[])
return 0;
}
+ if (strcmp(cmd, "bookmark") == 0) { /** **/
+ int ret = bookmark(&snac, url);
+ if (ret < 0) {
+ fprintf(stderr, "error bookmarking %s %d\n", url, ret);
+ return 1;
+ }
+
+ return 0;
+ }
+
+ if (strcmp(cmd, "unbookmark") == 0) { /** **/
+ int ret = unbookmark(&snac, url);
+ if (ret < 0) {
+ fprintf(stderr, "error unbookmarking %s %d\n", url, ret);
+ return 1;
+ }
+
+ return 0;
+ }
+
if (strcmp(cmd, "question") == 0) { /** **/
int end_secs = 5 * 60;
xs *opts = xs_split(url, ";");
diff --git a/snac.h b/snac.h
index 7cf9b81..f428775 100644
--- a/snac.h
+++ b/snac.h
@@ -166,6 +166,10 @@ void mute(snac *snac, const char *actor);
void unmute(snac *snac, const char *actor);
int is_muted(snac *snac, const char *actor);
+int is_bookmarked(snac *user, const char *id);
+int bookmark(snac *user, const char *id);
+int unbookmark(snac *user, const char *id);
+
int pin(snac *user, const char *id);
int unpin(snac *user, const char *id);
int is_pinned(snac *user, const char *id);