this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

tests: Adding test for rhai link matching

Signed-off-by: Nick Gerakines <12125+ngerakines@users.noreply.github.com>

+27
+5
src/matcher.rs
··· 717 717 true, 718 718 "at://did:plc:cbkjy5n7bk3ax2wplmtjofq2/app.bsky.feed.post/3laadb7behk25", 719 719 ), 720 + ( 721 + "rhai_match_links.rhai", 722 + true, 723 + "at://did:plc:cbkjy5n7bk3ax2wplmtjofq2/app.bsky.feed.post/3laadb7behk25", 724 + ), 720 725 ], 721 726 ), 722 727 (
+22
testdata/rhai_match_links.rhai
··· 1 + let rtype = event?.commit?.record["$type"]; 2 + 3 + switch rtype { 4 + "app.bsky.feed.post" => { 5 + let links = []; 6 + for facet in event?.commit?.record?.facets ?? [] { 7 + for feature in facet?.features ?? [] { 8 + if feature?["$type"] == "app.bsky.richtext.facet#link" { 9 + links += feature?["uri"] 10 + } 11 + } 12 + } 13 + 14 + if "https://github.com/astrenoxcoop/supercell" in links { 15 + return build_aturi(event); 16 + } 17 + } 18 + // noop 19 + _ => { } 20 + } 21 + 22 + false