diff options
| author | 2024-10-27 09:06:56 +0100 | |
|---|---|---|
| committer | 2024-10-27 09:06:56 +0100 | |
| commit | ebd8b6137f7bb48c07f7cf48adc55e0bd27bc35f (patch) | |
| tree | bf229ba6bfe1e68e0c44d81158a961138b38d9e0 | |
| parent | Updated TODO. (diff) | |
| download | snac2-ebd8b6137f7bb48c07f7cf48adc55e0bd27bc35f.tar.gz snac2-ebd8b6137f7bb48c07f7cf48adc55e0bd27bc35f.tar.xz snac2-ebd8b6137f7bb48c07f7cf48adc55e0bd27bc35f.zip | |
Skip all repeated attachments, not only images.
| -rw-r--r-- | html.c | 9 |
1 files changed, 4 insertions, 5 deletions
| @@ -1943,12 +1943,11 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, | |||
| 1943 | const char *href = xs_dict_get(a, "href"); | 1943 | const char *href = xs_dict_get(a, "href"); |
| 1944 | const char *name = xs_dict_get(a, "name"); | 1944 | const char *name = xs_dict_get(a, "name"); |
| 1945 | 1945 | ||
| 1946 | if (xs_startswith(type, "image/") || strcmp(type, "Image") == 0) { | 1946 | /* if this image is already in the post content, skip */ |
| 1947 | 1947 | if (xs_str_in(content, href) != -1) | |
| 1948 | /* if this image is already in the post content, skip */ | 1948 | continue; |
| 1949 | if (xs_str_in(content, href) != -1) | ||
| 1950 | continue; | ||
| 1951 | 1949 | ||
| 1950 | if (xs_startswith(type, "image/") || strcmp(type, "Image") == 0) { | ||
| 1952 | xs_html_add(content_attachments, | 1951 | xs_html_add(content_attachments, |
| 1953 | xs_html_tag("a", | 1952 | xs_html_tag("a", |
| 1954 | xs_html_attr("href", href), | 1953 | xs_html_attr("href", href), |