diff options
| author | 2022-09-29 09:19:42 +0200 | |
|---|---|---|
| committer | 2022-09-29 09:19:42 +0200 | |
| commit | ab38029192e87b94923c31f2689a2e7025c47994 (patch) | |
| tree | 708443513bbea53bcc5f5bf822dcb18d4e8cc1f2 /html.c | |
| parent | html_entry() is built in its own string and then added. (diff) | |
| download | snac2-ab38029192e87b94923c31f2689a2e7025c47994.tar.gz snac2-ab38029192e87b94923c31f2689a2e7025c47994.tar.xz snac2-ab38029192e87b94923c31f2689a2e7025c47994.zip | |
More HTML work.
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 14 |
1 files changed, 8 insertions, 6 deletions
| @@ -143,11 +143,13 @@ int login(snac *snac, char *headers) | |||
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | 145 | ||
| 146 | d_char *html_msg_icon(snac *snac, d_char *s, char *msg) | 146 | d_char *html_msg_icon(snac *snac, d_char *os, char *msg) |
| 147 | { | 147 | { |
| 148 | char *actor_id; | 148 | char *actor_id; |
| 149 | xs *actor = NULL; | 149 | xs *actor = NULL; |
| 150 | 150 | ||
| 151 | xs *s = xs_str_new(NULL); | ||
| 152 | |||
| 151 | if ((actor_id = xs_dict_get(msg, "attributedTo")) == NULL) | 153 | if ((actor_id = xs_dict_get(msg, "attributedTo")) == NULL) |
| 152 | actor_id = xs_dict_get(msg, "actor"); | 154 | actor_id = xs_dict_get(msg, "actor"); |
| 153 | 155 | ||
| @@ -202,7 +204,7 @@ d_char *html_msg_icon(snac *snac, d_char *s, char *msg) | |||
| 202 | } | 204 | } |
| 203 | } | 205 | } |
| 204 | 206 | ||
| 205 | return s; | 207 | return xs_str_cat(os, s); |
| 206 | } | 208 | } |
| 207 | 209 | ||
| 208 | 210 | ||
| @@ -480,7 +482,7 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, xs_set *seen, int level) | |||
| 480 | } | 482 | } |
| 481 | } | 483 | } |
| 482 | 484 | ||
| 483 | s = xs_str_cat(s, "</div> <!-- e-content -->\n"); | 485 | s = xs_str_cat(s, "</div>\n"); |
| 484 | 486 | ||
| 485 | char *children = xs_dict_get(meta, "children"); | 487 | char *children = xs_dict_get(meta, "children"); |
| 486 | 488 | ||
| @@ -507,10 +509,10 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, xs_set *seen, int level) | |||
| 507 | left--; | 509 | left--; |
| 508 | } | 510 | } |
| 509 | 511 | ||
| 510 | s = xs_str_cat(s, "</div> <!-- snac-children -->\n"); | 512 | s = xs_str_cat(s, "</div>\n"); |
| 511 | } | 513 | } |
| 512 | 514 | ||
| 513 | s = xs_str_cat(s, "</div> <!-- post or child -->\n"); | 515 | s = xs_str_cat(s, "</div>\n"); |
| 514 | 516 | ||
| 515 | return xs_str_cat(os, s); | 517 | return xs_str_cat(os, s); |
| 516 | } | 518 | } |
| @@ -551,7 +553,7 @@ d_char *html_timeline(snac *snac, char *list, int local) | |||
| 551 | s = html_entry(snac, s, msg, seen, 0); | 553 | s = html_entry(snac, s, msg, seen, 0); |
| 552 | } | 554 | } |
| 553 | 555 | ||
| 554 | s = xs_str_cat(s, "</div> <!-- snac-posts -->\n"); | 556 | s = xs_str_cat(s, "</div>\n"); |
| 555 | 557 | ||
| 556 | s = html_user_footer(snac, s); | 558 | s = html_user_footer(snac, s); |
| 557 | 559 | ||