diff options
| author | 2023-05-29 09:20:37 +0200 | |
|---|---|---|
| committer | 2023-05-29 09:20:37 +0200 | |
| commit | 60ea9b3a0989599fd05459ca12ca9158298c1065 (patch) | |
| tree | e62f06cf049a0571b67cb8b17b7b485435b36edf | |
| parent | Disallow voting your own polls. (diff) | |
| download | snac2-60ea9b3a0989599fd05459ca12ca9158298c1065.tar.gz snac2-60ea9b3a0989599fd05459ca12ca9158298c1065.tar.xz snac2-60ea9b3a0989599fd05459ca12ca9158298c1065.zip | |
Disallow updating closed polls.
| -rw-r--r-- | activitypub.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activitypub.c b/activitypub.c index 2dfbf80..a906463 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -983,10 +983,14 @@ int update_question(snac *user, const char *id) | |||
| 983 | if (!valid_status(object_get(id, &msg))) | 983 | if (!valid_status(object_get(id, &msg))) |
| 984 | return -1; | 984 | return -1; |
| 985 | 985 | ||
| 986 | /* closed? do nothing more */ | ||
| 987 | if (xs_dict_get(msg, "closed")) | ||
| 988 | return -2; | ||
| 989 | |||
| 986 | /* get the options */ | 990 | /* get the options */ |
| 987 | if ((opts = xs_dict_get(msg, "oneOf")) == NULL && | 991 | if ((opts = xs_dict_get(msg, "oneOf")) == NULL && |
| 988 | (opts = xs_dict_get(msg, "anyOf")) == NULL) | 992 | (opts = xs_dict_get(msg, "anyOf")) == NULL) |
| 989 | return -2; | 993 | return -3; |
| 990 | 994 | ||
| 991 | /* fill the initial count */ | 995 | /* fill the initial count */ |
| 992 | p = opts; | 996 | p = opts; |