cave/activitypub: ignore more weird tags

This commit is contained in:
Astro 2023-10-22 02:35:08 +02:00
parent 6a78081469
commit 6f11e5a1fb
1 changed files with 9 additions and 5 deletions

View File

@ -118,12 +118,16 @@ impl Post {
while tag.name.chars().next() == Some('#') {
tag.name.remove(0);
}
if tag.name.chars().next() == Some('@') {
// why do these occur?
None
} else if tag.name.len() > 0 {
Some(tag)
if let Some(c) = tag.name.chars().next() {
// check the first letter
if ['@', ':'].contains(&c) {
// these are weird
None
} else {
Some(tag)
}
} else {
// no first letter
None
}
}).collect(),