diff options
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 16 |
1 files changed, 9 insertions, 7 deletions
| @@ -368,7 +368,7 @@ d_char *html_top_controls(snac *snac, d_char *s) | |||
| 368 | } | 368 | } |
| 369 | 369 | ||
| 370 | 370 | ||
| 371 | d_char *html_entry(snac *snac, d_char *s, char *msg, xs_set *seen, int level) | 371 | d_char *html_entry(snac *snac, d_char *os, char *msg, xs_set *seen, int level) |
| 372 | { | 372 | { |
| 373 | char *id = xs_dict_get(msg, "id"); | 373 | char *id = xs_dict_get(msg, "id"); |
| 374 | char *type = xs_dict_get(msg, "type"); | 374 | char *type = xs_dict_get(msg, "type"); |
| @@ -378,17 +378,19 @@ d_char *html_entry(snac *snac, d_char *s, char *msg, xs_set *seen, int level) | |||
| 378 | 378 | ||
| 379 | /* return if already seen */ | 379 | /* return if already seen */ |
| 380 | if (xs_set_add(seen, id) == 0) | 380 | if (xs_set_add(seen, id) == 0) |
| 381 | return s; | 381 | return os; |
| 382 | 382 | ||
| 383 | if (strcmp(type, "Follow") == 0) | 383 | if (strcmp(type, "Follow") == 0) |
| 384 | return s; | 384 | return os; |
| 385 | 385 | ||
| 386 | /* bring the main actor */ | 386 | /* bring the main actor */ |
| 387 | if ((actor = xs_dict_get(msg, "attributedTo")) == NULL) | 387 | if ((actor = xs_dict_get(msg, "attributedTo")) == NULL) |
| 388 | return s; | 388 | return os; |
| 389 | 389 | ||
| 390 | if (!valid_status(actor_get(snac, actor, &actor_o))) | 390 | if (!valid_status(actor_get(snac, actor, &actor_o))) |
| 391 | return s; | 391 | return os; |
| 392 | |||
| 393 | xs *s = xs_str_new(NULL); | ||
| 392 | 394 | ||
| 393 | /* if this is our post, add the score */ | 395 | /* if this is our post, add the score */ |
| 394 | if (xs_startswith(id, snac->actor)) { | 396 | if (xs_startswith(id, snac->actor)) { |
| @@ -422,7 +424,7 @@ d_char *html_entry(snac *snac, d_char *s, char *msg, xs_set *seen, int level) | |||
| 422 | "<a href=\"%s\">%s</a> %s</div>\n", | 424 | "<a href=\"%s\">%s</a> %s</div>\n", |
| 423 | xs_dict_get(actor_r, "id"), | 425 | xs_dict_get(actor_r, "id"), |
| 424 | name, | 426 | name, |
| 425 | "boosted" | 427 | L("boosted") |
| 426 | ); | 428 | ); |
| 427 | 429 | ||
| 428 | s = xs_str_cat(s, s1); | 430 | s = xs_str_cat(s, s1); |
| @@ -510,7 +512,7 @@ d_char *html_entry(snac *snac, d_char *s, char *msg, xs_set *seen, int level) | |||
| 510 | 512 | ||
| 511 | s = xs_str_cat(s, "</div> <!-- post or child -->\n"); | 513 | s = xs_str_cat(s, "</div> <!-- post or child -->\n"); |
| 512 | 514 | ||
| 513 | return s; | 515 | return xs_str_cat(os, s); |
| 514 | } | 516 | } |
| 515 | 517 | ||
| 516 | 518 | ||