From 0934a84de9e4f550be18c0a7edacf1587e0da720 Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 6 Jul 2024 05:27:35 +0200 Subject: [PATCH] fix: skip lemmy community hashtags --- upub/core/src/traits/normalize.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/upub/core/src/traits/normalize.rs b/upub/core/src/traits/normalize.rs index ba0a7056..f1c16ea4 100644 --- a/upub/core/src/traits/normalize.rs +++ b/upub/core/src/traits/normalize.rs @@ -113,6 +113,18 @@ impl Normalizer for crate::Context { let hashtag = l.name() .unwrap_or_else(|_| l.href().unwrap_or_default().split('/').last().unwrap_or_default()) // TODO maybe just fail? .replace('#', ""); + // TODO lemmy added a "fix" to make its communities kind of work with mastodon: + // basically they include the community name as hashtag. ughhhh, since we handle + // hashtags and audience it means our hashtags gets clogged with posts from lemmy + // communities. it kind of make sense to include them since they fit the hashtag + // theme, but nonetheless it's annoying and i'd rather not have the two things + // mixed. maybe it's just me and this should go instead? maybe this has other + // issues and it's just not worth fixing this tiny lemmy kink? idkk + if let Some(ref audience) = object_model.audience { + if audience.ends_with(&hashtag) { + continue; + } + } let model = crate::model::hashtag::ActiveModel { internal: NotSet, object: Set(object_model.internal),