Skip to content

Commit

Permalink
Text no fulltext for paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Harlan T Wood committed Jul 1, 2023
1 parent fbaf77e commit a676be3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
12 changes: 11 additions & 1 deletion dnas/mewsfeed/zomes/coordinator/mews/src/all_mews.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub fn get_trusted_mews_with_context(input: RecommendedInput) -> ExternResult<Ve
let oldest_mew_seconds = input.oldest_mew_seconds.unwrap_or(60 * 60 * 24 * 7 * 2);

// get all TrustAtoms -- topic/author combos "rated" by this agent
let topics_by_author: Vec<TrustAtom> = call_local_zome(
let trust_atoms: Vec<TrustAtom> = call_local_zome(
"trust_atom",
"query_mine",
QueryMineInput {
Expand All @@ -42,6 +42,16 @@ pub fn get_trusted_mews_with_context(input: RecommendedInput) -> ExternResult<Ve
},
)?;

let topics_by_author: Vec<TrustAtom> = trust_atoms
.into_iter()
.filter(|atom| match atom.content.clone() {
Some(content) => content != FOLLOW_TOPIC,
None => true,
})
.collect();

// debug!("topics_by_author: {:#?}", topics_by_author);

// filter for those TrustAtoms above a weight threshold (>= 0)
let recomended_topics_by_author =
topics_by_author
Expand Down
4 changes: 2 additions & 2 deletions dnas/mewsfeed/zomes/coordinator/mews/src/hashtag_to_mews.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub fn add_hashtag_by_author_for_mew(input: AddHashtagForMewInput) -> ExternResu
let path_text = format!("{}.{}", tag_text, me);
debug!("path_text on create --- {}", path_text);

let path = prefix_index.add_result_with_label(path_text, input.base_hashtag.clone())?; // TODO what should full_text be?
let path = prefix_index.add_result(path_text)?;

// Link from hashtag to mew_hash
create_link(
Expand Down Expand Up @@ -118,7 +118,7 @@ pub fn get_mews_for_hashtag_by_author_with_context(
let path_text = format!("{}.{}", tag, agent);
debug!("path_text --- {}", path_text);

let result_path: Path = prefix_index.make_result_path(path_text, Some(hashtag))?;
let result_path: Path = prefix_index.make_result_path(path_text, None)?;

let links = get_links(
result_path.path_entry_hash()?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ test("Weighted followed creators mews should be ordered by topic weights descend
links: [],
});

// TODO something like this -- maybe in common.ts?
// await awaitDhtIntegration([ann, bob], alice.cells[0].cell_id[0]);
await pause(2_000);

let trustFeed = await ann.trustFeed({
now: Date.now(),
Expand Down

0 comments on commit a676be3

Please sign in to comment.