diff options
| author | 2023-10-09 11:49:45 +0200 | |
|---|---|---|
| committer | 2023-10-09 11:49:45 +0200 | |
| commit | 1b3f768a57f42c3fab5363fc60b88912ebf649ee (patch) | |
| tree | c71a2b6eb23aa9d46991045c59f448f035050218 /mastoapi.c | |
| parent | The HTML user page does not show an error, only the empty header. (diff) | |
| download | snac2-1b3f768a57f42c3fab5363fc60b88912ebf649ee.tar.gz snac2-1b3f768a57f42c3fab5363fc60b88912ebf649ee.tar.xz snac2-1b3f768a57f42c3fab5363fc60b88912ebf649ee.zip | |
mastoapi: some tweaks to better match the returned data in timelines.
Diffstat (limited to 'mastoapi.c')
| -rw-r--r-- | mastoapi.c | 23 |
1 files changed, 14 insertions, 9 deletions
| @@ -1265,7 +1265,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1265 | if (limit == 0) | 1265 | if (limit == 0) |
| 1266 | limit = 20; | 1266 | limit = 20; |
| 1267 | 1267 | ||
| 1268 | xs *timeline = timeline_simple_list(&snac1, "private", 0, 256); | 1268 | xs *timeline = timeline_simple_list(&snac1, "private", 0, 2048); |
| 1269 | 1269 | ||
| 1270 | xs *out = xs_list_new(); | 1270 | xs *out = xs_list_new(); |
| 1271 | xs_list *p = timeline; | 1271 | xs_list *p = timeline; |
| @@ -1304,19 +1304,24 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1304 | if (strcmp(type, "Note") != 0 && strcmp(type, "Question") != 0) | 1304 | if (strcmp(type, "Note") != 0 && strcmp(type, "Question") != 0) |
| 1305 | continue; | 1305 | continue; |
| 1306 | 1306 | ||
| 1307 | #if 0 | 1307 | const char *atto = xs_dict_get(msg, "attributedTo"); |
| 1308 | /* discard notes from people we don't follow with no boosts */ | 1308 | const char *id = xs_dict_get(msg, "id"); |
| 1309 | if (!following_check(&snac1, xs_dict_get(msg, "attributedTo")) && | 1309 | |
| 1310 | object_announces_len(xs_dict_get(msg, "id")) == 0) | 1310 | /* is this message from a person we don't follow? */ |
| 1311 | continue; | 1311 | if (strcmp(atto, snac1.actor) && !following_check(&snac1, atto)) { |
| 1312 | #endif | 1312 | /* if we didn't boost it, discard */ |
| 1313 | xs *idx = object_announces(id); | ||
| 1314 | |||
| 1315 | if (xs_list_in(idx, snac1.md5) == -1) | ||
| 1316 | continue; | ||
| 1317 | } | ||
| 1313 | 1318 | ||
| 1314 | /* discard notes from muted morons */ | 1319 | /* discard notes from muted morons */ |
| 1315 | if (is_muted(&snac1, xs_dict_get(msg, "attributedTo"))) | 1320 | if (is_muted(&snac1, atto)) |
| 1316 | continue; | 1321 | continue; |
| 1317 | 1322 | ||
| 1318 | /* discard hidden notes */ | 1323 | /* discard hidden notes */ |
| 1319 | if (is_hidden(&snac1, xs_dict_get(msg, "id"))) | 1324 | if (is_hidden(&snac1, id)) |
| 1320 | continue; | 1325 | continue; |
| 1321 | 1326 | ||
| 1322 | /* discard poll votes (they have a name) */ | 1327 | /* discard poll votes (they have a name) */ |