summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authorGravatar default2024-01-18 23:04:37 +0100
committerGravatar default2024-01-18 23:04:37 +0100
commit65040b65a35e36423e7154e643d9c69401ec5b2c (patch)
treef6e0c65299925e342920586f183c1fff4d3b8c2a /data.c
parentDeleted breakpoint. (diff)
downloadsnac2-65040b65a35e36423e7154e643d9c69401ec5b2c.tar.gz
snac2-65040b65a35e36423e7154e643d9c69401ec5b2c.tar.xz
snac2-65040b65a35e36423e7154e643d9c69401ec5b2c.zip
New function get_atto(), to get the attributedTo field.
Diffstat (limited to 'data.c')
-rw-r--r--data.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/data.c b/data.c
index c8292ef..d9816a0 100644
--- a/data.c
+++ b/data.c
@@ -2345,7 +2345,8 @@ int was_question_voted(snac *user, const char *id)
2345 xs *obj = NULL; 2345 xs *obj = NULL;
2346 2346
2347 if (valid_status(object_get_by_md5(md5, &obj))) { 2347 if (valid_status(object_get_by_md5(md5, &obj))) {
2348 if (strcmp(xs_dict_get(obj, "attributedTo"), user->actor) == 0 && 2348 char *atto = get_atto(obj);
2349 if (atto && strcmp(atto, user->actor) == 0 &&
2349 !xs_is_null(xs_dict_get(obj, "name"))) { 2350 !xs_is_null(xs_dict_get(obj, "name"))) {
2350 voted = 1; 2351 voted = 1;
2351 break; 2352 break;