diff options
| -rw-r--r-- | activitypub.c | 2 | ||||
| -rw-r--r-- | html.c | 5 | ||||
| -rw-r--r-- | snac.h | 4 |
3 files changed, 8 insertions, 3 deletions
diff --git a/activitypub.c b/activitypub.c index 162324e..f754ee0 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -310,7 +310,7 @@ int timeline_request(snac *snac, char **id, xs_str **wrk, int level) | |||
| 310 | { | 310 | { |
| 311 | int status = 0; | 311 | int status = 0; |
| 312 | 312 | ||
| 313 | if (level < 256 && !xs_is_null(*id)) { | 313 | if (level < MAX_CONVERSATION_LEVELS && !xs_is_null(*id)) { |
| 314 | xs *msg = NULL; | 314 | xs *msg = NULL; |
| 315 | 315 | ||
| 316 | /* is the object already there? */ | 316 | /* is the object already there? */ |
| @@ -1334,8 +1334,9 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, | |||
| 1334 | } | 1334 | } |
| 1335 | 1335 | ||
| 1336 | /* avoid too deep nesting, as it may be a loop */ | 1336 | /* avoid too deep nesting, as it may be a loop */ |
| 1337 | if (level >= 256) | 1337 | if (level >= MAX_CONVERSATION_LEVELS) |
| 1338 | return NULL; | 1338 | return xs_html_tag("mark", |
| 1339 | xs_html_text(L("Truncated (too deep)"))); | ||
| 1339 | 1340 | ||
| 1340 | if (strcmp(type, "Follow") == 0) { | 1341 | if (strcmp(type, "Follow") == 0) { |
| 1341 | return xs_html_tag("div", | 1342 | return xs_html_tag("div", |
| @@ -16,6 +16,10 @@ | |||
| 16 | #define MAX_THREADS 256 | 16 | #define MAX_THREADS 256 |
| 17 | #endif | 17 | #endif |
| 18 | 18 | ||
| 19 | #ifndef MAX_CONVERSATION_LEVELS | ||
| 20 | #define MAX_CONVERSATION_LEVELS 48 | ||
| 21 | #endif | ||
| 22 | |||
| 19 | extern double disk_layout; | 23 | extern double disk_layout; |
| 20 | extern xs_str *srv_basedir; | 24 | extern xs_str *srv_basedir; |
| 21 | extern xs_dict *srv_config; | 25 | extern xs_dict *srv_config; |