diff options
| author | default <nobody@localhost> | 2025-01-06 18:04:56 +0100 |
|---|---|---|
| committer | default <nobody@localhost> | 2025-01-06 18:04:56 +0100 |
| commit | 00eb86deaf1c4e00f44e15ca13bb9fe9984e57aa (patch) | |
| tree | b32a388fdad722d2f02a231dc17e16fa84fa2fa7 /main.c | |
| parent | f6e06be2781a1e56f2fbc088e14d5788eeb4c237 (diff) | |
New command-line operation 'note_unlisted'.
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -33,6 +33,7 @@ int usage(void) printf("insert {basedir} {uid} {url} Requests an object and inserts it into the timeline\n"); printf("actor {basedir} [{uid}] {url} Requests an actor\n"); printf("note {basedir} {uid} {text} [files...] Sends a note with optional attachments\n"); + printf("note_unlisted {basedir} {uid} {text} [files...] Sends an unlisted note with optional attachments\n"); printf("boost|announce {basedir} {uid} {url} Boosts (announces) a post\n"); printf("unboost {basedir} {uid} {url} Unboosts a post\n"); printf("resetpwd {basedir} {uid} Resets the password of a user\n"); @@ -603,7 +604,7 @@ int main(int argc, char *argv[]) return 0; } - if (strcmp(cmd, "note") == 0) { /** **/ + if (strcmp(cmd, "note") == 0 || strcmp(cmd, "note_unlisted") == 0) { /** **/ xs *content = NULL; xs *msg = NULL; xs *c_msg = NULL; @@ -669,6 +670,14 @@ int main(int argc, char *argv[]) msg = msg_note(&snac, content, NULL, NULL, attl, 0, getenv("LANG")); + if (strcmp(cmd, "note_unlisted") == 0) { + /* according to Mastodon, "unlisted" posts (now called "quiet public") + has the public address as a cc instead of to, so toggle it */ + xs *to = xs_dup(xs_dict_get(msg, "to")); + msg = xs_dict_set(msg, "cc", to); + msg = xs_dict_set(msg, "to", xs_stock(XSTYPE_LIST)); + } + c_msg = msg_create(&snac, msg); if (dbglevel) { |