mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-12-25 16:53:37 +00:00
Don't inline empty avatars in og:avatar meta property.
This commit is contained in:
parent
91d670a627
commit
ec48ec314f
1 changed files with 9 additions and 1 deletions
10
html.c
10
html.c
|
@ -226,6 +226,14 @@ d_char *html_user_header(snac *snac, d_char *s, int local)
|
|||
s_bio[n] != '\r' && s_bio[n] != '\n' && n < 128; n++);
|
||||
s_bio[n] = '\0';
|
||||
|
||||
xs *s_avatar = xs_dup(avatar);
|
||||
|
||||
/* don't inline an empty avatar: create a real link */
|
||||
if (xs_startswith(s_avatar, "data:")) {
|
||||
xs_free(s_avatar);
|
||||
s_avatar = xs_fmt("%s/susie.png", srv_baseurl);
|
||||
}
|
||||
|
||||
/* og properties */
|
||||
xs *s1 = xs_fmt(
|
||||
"<meta property=\"og:site_name\" content=\"%s\"/>\n"
|
||||
|
@ -239,7 +247,7 @@ d_char *html_user_header(snac *snac, d_char *s, int local)
|
|||
snac->uid,
|
||||
xs_dict_get(srv_config, "host"),
|
||||
s_bio,
|
||||
avatar);
|
||||
s_avatar);
|
||||
s = xs_str_cat(s, s1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue