mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-25 22:45:05 +00:00
Also add the rel=me to metadata links in msg_actor().
This commit is contained in:
parent
ec35ad451f
commit
09d680e7dc
1 changed files with 10 additions and 1 deletions
|
@ -1221,6 +1221,10 @@ xs_dict *msg_actor(snac *snac)
|
|||
xs_str *k;
|
||||
xs_str *v;
|
||||
|
||||
xs_dict *val_metadata = xs_dict_get(snac->config, "validated_metadata");
|
||||
if (xs_is_null(val_metadata))
|
||||
val_metadata = xs_stock_dict;
|
||||
|
||||
while (xs_dict_iter(&metadata, &k, &v)) {
|
||||
xs *d = xs_dict_new();
|
||||
|
||||
|
@ -1228,7 +1232,12 @@ xs_dict *msg_actor(snac *snac)
|
|||
xs *v2 = NULL;
|
||||
|
||||
if (xs_startswith(v, "https:")) {
|
||||
char *val_date = xs_dict_get(val_metadata, v);
|
||||
xs *t = encode_html(v);
|
||||
|
||||
if (xs_type(val_date) == XSTYPE_STRING && *val_date)
|
||||
v2 = xs_fmt("<a href=\"%s\" rel=\"me\">%s</a>", t, t);
|
||||
else
|
||||
v2 = xs_fmt("<a href=\"%s\">%s</a>", t, t);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue