@@ -3,6 +3,7 @@ use hdk::prelude::*;
33use zome_signals:: * ;
44use zome_tagging_integrity:: * ;
55use zome_utils:: * ;
6+ use zome_path:: * ;
67
78fn root_path ( ) -> ExternResult < TypedPath > {
89 let tp = Path :: from ( format ! ( "{}" , PUBLIC_TAG_ROOT ) ) . typed ( TaggingLinkTypes :: PublicPath ) ?;
@@ -11,10 +12,10 @@ fn root_path() -> ExternResult<TypedPath> {
1112
1213///
1314#[ hdk_extern]
14- fn probe_public_tags ( _ : ( ) ) -> ExternResult < Vec < ( EntryHash , String ) > > {
15+ fn probe_public_tags ( strategy : GetStrategy ) -> ExternResult < Vec < ( EntryHash , String ) > > {
1516 std:: panic:: set_hook ( Box :: new ( zome_panic_hook) ) ;
1617 let root_tp = root_path ( ) ?;
17- let links = tp_children ( & root_tp) ?;
18+ let links = tp_children ( & root_tp, strategy ) ?;
1819 let children = links_to_paths ( & root_tp, links. clone ( ) ) ?;
1920 debug ! ( "children_links: {:?}" , links) ;
2021 debug ! ( "children: {:?}" , children) ;
@@ -39,7 +40,7 @@ fn probe_public_tags(_: ()) -> ExternResult<Vec<(EntryHash, String)>> {
3940fn publish_public_tag ( tag_value : String ) -> ExternResult < EntryHash > {
4041 std:: panic:: set_hook ( Box :: new ( zome_panic_hook) ) ;
4142 /// Make sure Tag does not already exists
42- for ( eh, tag) in probe_public_tags ( ( ) ) ? {
43+ for ( eh, tag) in probe_public_tags ( GetStrategy :: Network ) ? {
4344 if tag == tag_value {
4445 return Ok ( eh) ;
4546 }
@@ -62,8 +63,8 @@ fn publish_public_tag(tag_value: String) -> ExternResult<EntryHash> {
6263
6364///
6465pub fn fetch_public_entry ( eh : EntryHash ) -> ExternResult < Entry > {
65- let entry = get_entry_from_eh ( eh. clone ( ) ) ?;
66- let entry_type = get_entry_type ( & entry) ?;
66+ let entry = get_entry_from_eh ( eh. clone ( ) , GetStrategy :: Network ) ?;
67+ let entry_type = get_entry_type ( & entry, GetStrategy :: Network ) ?;
6768 if !entry_type. visibility ( ) . is_public ( ) {
6869 return error ( "Entry is Private" ) ;
6970 }
@@ -82,7 +83,7 @@ fn tag_public_entry(input: TaggingInput) -> ExternResult<Vec<ActionHash>> {
8283 /// Make sure entry exist and is public
8384 let _entry = fetch_public_entry ( input. target . clone ( ) ) ?;
8485 /// Grab existing public tags
85- let public_tuples = probe_public_tags ( ( ) ) ?;
86+ let public_tuples = probe_public_tags ( GetStrategy :: Network ) ?;
8687 let public_tags: Vec < String > = public_tuples. iter ( ) . map ( |( _, tag) | tag. to_owned ( ) ) . collect ( ) ;
8788 /// Link to/from each tag (create PublicTag entry if necessary)
8889 let mut link_ahs = Vec :: new ( ) ;
0 commit comments