mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 05:15:04 +00:00
In build_mentions(), avoid adding a user handle more than once.
This commit is contained in:
parent
ceda5bab31
commit
74ce67a631
1 changed files with 7 additions and 3 deletions
4
html.c
4
html.c
|
@ -1111,15 +1111,19 @@ xs_str *build_mentions(snac *snac, const xs_dict *msg)
|
|||
|
||||
if (xs_list_len(l2) >= 3) {
|
||||
xs *s1 = xs_fmt("%s@%s ", name, xs_list_get(l2, 2));
|
||||
|
||||
if (xs_str_in(s, s1) == -1)
|
||||
s = xs_str_cat(s, s1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (xs_str_in(s, name) == -1) {
|
||||
s = xs_str_cat(s, name);
|
||||
s = xs_str_cat(s, " ");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (*s) {
|
||||
xs *s1 = s;
|
||||
|
|
Loading…
Reference in a new issue