Skip to content

Commit 478603e

Browse files
committed
contacts: disable hashtag follows for now
People are spamming hashtags with AI CP. Let's disable this until we at least have image blurring. Alternatively we could only show the link for people you don't follow. Signed-off-by: William Casarin <[email protected]>
1 parent d0265a5 commit 478603e

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

crates/notedeck/src/filter.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,11 @@ impl FilteredTags {
192192

193193
/// Create a filter from tags. This can be used to create a filter
194194
/// from a contact list
195-
pub fn filter_from_tags(note: &Note, add_pubkey: Option<&[u8; 32]>) -> Result<FilteredTags> {
195+
pub fn filter_from_tags(
196+
note: &Note,
197+
add_pubkey: Option<&[u8; 32]>,
198+
with_hashtags: bool,
199+
) -> Result<FilteredTags> {
196200
let mut author_filter = Filter::new();
197201
let mut hashtag_filter = Filter::new();
198202
let mut author_res: Option<FilterBuilder> = None;
@@ -233,7 +237,7 @@ pub fn filter_from_tags(note: &Note, add_pubkey: Option<&[u8; 32]>) -> Result<Fi
233237

234238
author_filter.add_id_element(author)?;
235239
author_count += 1;
236-
} else if t == "t" {
240+
} else if t == "t" && with_hashtags {
237241
let hashtag = if let Some(hashtag) = tag.get_unchecked(1).variant().str() {
238242
hashtag
239243
} else {

crates/notedeck_columns/src/timeline/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@ impl Timeline {
204204
deck_author: Option<&[u8; 32]>,
205205
) -> Result<Self> {
206206
let our_pubkey = deck_author.map(|da| pk_src.to_pubkey_bytes(da));
207-
let filter = filter::filter_from_tags(contact_list, our_pubkey)?.into_follow_filter();
207+
let with_hashtags = false;
208+
let filter =
209+
filter::filter_from_tags(contact_list, our_pubkey, with_hashtags)?.into_follow_filter();
208210

209211
Ok(Timeline::new(
210212
TimelineKind::contact_list(pk_src),
@@ -689,6 +691,7 @@ pub fn is_timeline_ready(
689691
info!("notes found for contact timeline after GotRemote!");
690692

691693
let note_key = res[0];
694+
let with_hashtags = false;
692695

693696
let filter = {
694697
let txn = Transaction::new(ndb).expect("txn");
@@ -698,7 +701,7 @@ pub fn is_timeline_ready(
698701
.pubkey_source()
699702
.as_ref()
700703
.and_then(|pk_src| our_pk.map(|pk| pk_src.to_pubkey_bytes(pk)));
701-
filter::filter_from_tags(&note, add_pk).map(|f| f.into_follow_filter())
704+
filter::filter_from_tags(&note, add_pk, with_hashtags).map(|f| f.into_follow_filter())
702705
};
703706

704707
// TODO: into_follow_filter is hardcoded to contact lists, let's generalize

0 commit comments

Comments
 (0)