diff options
| author | grunfink <grunfink@noreply.codeberg.org> | 2025-09-28 15:46:56 +0200 |
|---|---|---|
| committer | grunfink <grunfink@noreply.codeberg.org> | 2025-09-28 15:46:56 +0200 |
| commit | ab698c2bd6cbe74b2cca0a17fe210e159a43a2ce (patch) | |
| tree | 868fa6b77c7697f972cb7b9ea8d3ff49ab8652e1 /main.c | |
| parent | 65d868092cd8bddad703f9dad77867bb45ca3286 (diff) | |
| parent | 5610ffb13bebe2739cb865f47ee73725512ec600 (diff) | |
Merge pull request 'implementing scopes' (#474) from byte/snac2:feature/visibility into master
Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/474
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -45,6 +45,7 @@ int usage(const char *cmd) "note {basedir} {uid} {text} [files...] Sends a note with optional attachments\n" "note_unlisted {basedir} {uid} {text} [files...] Sends an unlisted note with optional attachments\n" "note_mention {basedir} {uid} {text} [files...] Sends a note only to mentioned accounts\n" + "note_followers {basedir} {uid} {text} [files...] Sends a note only to followers\n" "boost|announce {basedir} {uid} {url} Boosts (announces) a post\n" "unboost {basedir} {uid} {url} Unboosts a post\n" "resetpwd {basedir} {uid} Resets the password of a user\n" @@ -800,7 +801,8 @@ int main(int argc, char *argv[]) if (strcmp(cmd, "note") == 0 || /** **/ strcmp(cmd, "note_unlisted") == 0 || /** **/ - strcmp(cmd, "note_mention") == 0) { /** **/ + strcmp(cmd, "note_mention") == 0 || /** **/ + strcmp(cmd, "note_followers") == 0) { /** **/ xs *content = NULL; xs *msg = NULL; xs *c_msg = NULL; @@ -909,12 +911,15 @@ int main(int argc, char *argv[]) return 1; } - int scope = 0; + int scope = SCOPE_PUBLIC; if (strcmp(cmd, "note_mention") == 0) - scope = 1; + scope = SCOPE_MENTIONED; else if (strcmp(cmd, "note_unlisted") == 0) - scope = 2; + scope = SCOPE_UNLISTED; + else + if (strcmp(cmd, "note_followers") == 0) + scope = SCOPE_FOLLOWERS; msg = msg_note(&snac, content, NULL, in_reply_to, attl, scope, getenv("LANG"), post_date); |