commit fdb2be4

David Vaughan  ·  2026-02-05 02:40:08 +0000 UTC
parent 79cf2ca
Check global object store for poll id when voting via mastoapi
1 files changed,  +6, -1
+6, -1
 1@@ -3685,7 +3685,12 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path,
 2                 /* skip the 'fake' part of the id */
 3                 mid = MID_TO_MD5(mid);
 4 
 5-                if (valid_status(timeline_get_by_md5(&snac, mid, &msg))) {
 6+                /* try timeline first, then global object store for remote posts */
 7+                int found = valid_status(timeline_get_by_md5(&snac, mid, &msg));
 8+                if (!found)
 9+                    found = valid_status(object_get_by_md5(mid, &msg));
10+
11+                if (found) {
12                     const char *id   = xs_dict_get(msg, "id");
13                     const char *atto = get_atto(msg);
14