summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorGravatar grunfink2025-09-28 15:46:56 +0200
committerGravatar grunfink2025-09-28 15:46:56 +0200
commitab698c2bd6cbe74b2cca0a17fe210e159a43a2ce (patch)
tree868fa6b77c7697f972cb7b9ea8d3ff49ab8652e1 /main.c
parentTemporary tweak. (diff)
parentMerge branch 'master' into feature/visibility (diff)
downloadsnac2-ab698c2bd6cbe74b2cca0a17fe210e159a43a2ce.tar.gz
snac2-ab698c2bd6cbe74b2cca0a17fe210e159a43a2ce.tar.xz
snac2-ab698c2bd6cbe74b2cca0a17fe210e159a43a2ce.zip
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.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/main.c b/main.c
index f119197..46f88d2 100644
--- a/main.c
+++ b/main.c
@@ -45,6 +45,7 @@ int usage(const char *cmd)
45 "note {basedir} {uid} {text} [files...] Sends a note with optional attachments\n" 45 "note {basedir} {uid} {text} [files...] Sends a note with optional attachments\n"
46 "note_unlisted {basedir} {uid} {text} [files...] Sends an unlisted note with optional attachments\n" 46 "note_unlisted {basedir} {uid} {text} [files...] Sends an unlisted note with optional attachments\n"
47 "note_mention {basedir} {uid} {text} [files...] Sends a note only to mentioned accounts\n" 47 "note_mention {basedir} {uid} {text} [files...] Sends a note only to mentioned accounts\n"
48 "note_followers {basedir} {uid} {text} [files...] Sends a note only to followers\n"
48 "boost|announce {basedir} {uid} {url} Boosts (announces) a post\n" 49 "boost|announce {basedir} {uid} {url} Boosts (announces) a post\n"
49 "unboost {basedir} {uid} {url} Unboosts a post\n" 50 "unboost {basedir} {uid} {url} Unboosts a post\n"
50 "resetpwd {basedir} {uid} Resets the password of a user\n" 51 "resetpwd {basedir} {uid} Resets the password of a user\n"
@@ -800,7 +801,8 @@ int main(int argc, char *argv[])
800 801
801 if (strcmp(cmd, "note") == 0 || /** **/ 802 if (strcmp(cmd, "note") == 0 || /** **/
802 strcmp(cmd, "note_unlisted") == 0 || /** **/ 803 strcmp(cmd, "note_unlisted") == 0 || /** **/
803 strcmp(cmd, "note_mention") == 0) { /** **/ 804 strcmp(cmd, "note_mention") == 0 || /** **/
805 strcmp(cmd, "note_followers") == 0) { /** **/
804 xs *content = NULL; 806 xs *content = NULL;
805 xs *msg = NULL; 807 xs *msg = NULL;
806 xs *c_msg = NULL; 808 xs *c_msg = NULL;
@@ -909,12 +911,15 @@ int main(int argc, char *argv[])
909 return 1; 911 return 1;
910 } 912 }
911 913
912 int scope = 0; 914 int scope = SCOPE_PUBLIC;
913 if (strcmp(cmd, "note_mention") == 0) 915 if (strcmp(cmd, "note_mention") == 0)
914 scope = 1; 916 scope = SCOPE_MENTIONED;
915 else 917 else
916 if (strcmp(cmd, "note_unlisted") == 0) 918 if (strcmp(cmd, "note_unlisted") == 0)
917 scope = 2; 919 scope = SCOPE_UNLISTED;
920 else
921 if (strcmp(cmd, "note_followers") == 0)
922 scope = SCOPE_FOLLOWERS;
918 923
919 msg = msg_note(&snac, content, NULL, in_reply_to, attl, scope, getenv("LANG"), post_date); 924 msg = msg_note(&snac, content, NULL, in_reply_to, attl, scope, getenv("LANG"), post_date);
920 925