commit 2b64892

poesty  ·  2023-06-10 06:35:16 +0000 UTC
parent 56c44eb
Use MID_TO_MD5 for ID comparison
1 files changed,  +3, -3
+3, -3
 1@@ -1172,7 +1172,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
 2 
 3                 /* only return entries older that max_id */
 4                 if (max_id) {
 5-                    if (strcmp(v, max_id + 10) == 0)
 6+                    if (strcmp(v, MID_TO_MD5(max_id)) == 0)
 7                         max_id = NULL;
 8 
 9                     continue;
10@@ -1180,14 +1180,14 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
11 
12                 /* only returns entries newer than since_id */
13                 if (since_id) {
14-                    if (strcmp(v, since_id + 10) == 0)
15+                    if (strcmp(v, MID_TO_MD5(since_id)) == 0)
16                         break;
17                 }
18 
19                 /* only returns entries newer than min_id */
20                 /* what does really "Return results immediately newer than ID" mean? */
21                 if (min_id) {
22-                    if (strcmp(v, min_id + 10) == 0)
23+                    if (strcmp(v, MID_TO_MD5(min_id)) == 0)
24                         break;
25                 }
26