summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authorGravatar grunfink2025-12-02 09:53:58 +0100
committerGravatar grunfink2025-12-02 09:53:58 +0100
commit534ee6795aa4eb429846fab94a18036424485363 (patch)
tree93c9f3f9dc187fe7aa38e882879f72353b273925 /html.c
parentMoved is_msg_mine() to data.c. (diff)
parentFix user matching (diff)
downloadsnac2-534ee6795aa4eb429846fab94a18036424485363.tar.gz
snac2-534ee6795aa4eb429846fab94a18036424485363.tar.xz
snac2-534ee6795aa4eb429846fab94a18036424485363.zip
Merge pull request 'fix user matching' (#502) from rakoo/snac2:master into master
Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/502
Diffstat (limited to 'html.c')
-rw-r--r--html.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/html.c b/html.c
index 12d269a..d6223b9 100644
--- a/html.c
+++ b/html.c
@@ -1898,7 +1898,7 @@ xs_html *html_entry_controls(snac *user, const char *actor,
1898 xs_html_attr("name", "redir"), 1898 xs_html_attr("name", "redir"),
1899 xs_html_attr("value", redir)))); 1899 xs_html_attr("value", redir))));
1900 1900
1901 if (!xs_startswith(id, user->actor)) { 1901 if (!is_msg_mine(user, id)) {
1902 if (xs_list_in(likes, user->md5) == -1) { 1902 if (xs_list_in(likes, user->md5) == -1) {
1903 /* not already liked; add button */ 1903 /* not already liked; add button */
1904 xs_html_add(form, 1904 xs_html_add(form,
@@ -2426,7 +2426,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
2426 if (read_only) 2426 if (read_only)
2427 closed = 1; /* non-identified page; show as closed */ 2427 closed = 1; /* non-identified page; show as closed */
2428 else 2428 else
2429 if (user && xs_startswith(id, user->actor)) 2429 if (user && is_msg_mine(user, id))
2430 closed = 1; /* we questioned; closed for us */ 2430 closed = 1; /* we questioned; closed for us */
2431 else 2431 else
2432 if (user && was_question_voted(user, id)) 2432 if (user && was_question_voted(user, id))
@@ -5022,7 +5022,7 @@ int html_post_handler(const xs_dict *req, const char *q_path,
5022 } 5022 }
5023 else { 5023 else {
5024 /* delete an entry */ 5024 /* delete an entry */
5025 if (xs_startswith(id, snac.actor) && !is_draft(&snac, id)) { 5025 if (is_msg_mine(&snac, id) && !is_draft(&snac, id)) {
5026 /* it's a post by us: generate a delete */ 5026 /* it's a post by us: generate a delete */
5027 xs *msg = msg_delete(&snac, id); 5027 xs *msg = msg_delete(&snac, id);
5028 5028