From 6f11e5a1fb7a34489a8de1c32134a5daa6fe8c25 Mon Sep 17 00:00:00 2001 From: Astro Date: Sun, 22 Oct 2023 02:35:08 +0200 Subject: [PATCH] cave/activitypub: ignore more weird tags --- cave/src/activitypub/mod.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/cave/src/activitypub/mod.rs b/cave/src/activitypub/mod.rs index a95d7ec..2564198 100644 --- a/cave/src/activitypub/mod.rs +++ b/cave/src/activitypub/mod.rs @@ -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(),