commit 60ea9b3

default  ·  2023-05-29 07:20:37 +0000 UTC
parent 22fea17
Disallow updating closed polls.
1 files changed,  +5, -1
+5, -1
 1@@ -983,10 +983,14 @@ int update_question(snac *user, const char *id)
 2     if (!valid_status(object_get(id, &msg)))
 3         return -1;
 4 
 5+    /* closed? do nothing more */
 6+    if (xs_dict_get(msg, "closed"))
 7+        return -2;
 8+
 9     /* get the options */
10     if ((opts = xs_dict_get(msg, "oneOf")) == NULL &&
11         (opts = xs_dict_get(msg, "anyOf")) == NULL)
12-        return -2;
13+        return -3;
14 
15     /* fill the initial count */
16     p = opts;