diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Properties.hs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/Properties.hs b/lib/Properties.hs index 37b6bc4..dd680ea 100644 --- a/lib/Properties.hs +++ b/lib/Properties.hs @@ -40,7 +40,7 @@ import LintWriter (LintWriter, adjust, askContext, askFileDepth, import Paths (PathResult (..), RelPath (..), getExtension, isOldStyle, parsePath) import Types (Dep (Link, Local, LocalMap, MapLink)) -import Uris (SubstError (..), applySubst) +import Uris (SubstError (..), applySubst, parseUri) -- | Checks an entire map for "general" lints. @@ -289,15 +289,16 @@ checkTileLayerProperty p@(Property name _value) = case name of isIntInRange 0 100 p "bbbRoom" -> do removeProperty "bbbRoom" - unwrapURI (Proxy @"bbb") p - (\link -> do - dependsOn (Link link) - setProperty "openWebsite" link - setProperty "silent" (BoolProp True) - setProperty "openWebsitePolicy" - ("fullscreen;camera;microphone;display-capture" :: Text) - ) - (const $ complain "property \"bbbRoom\" cannot be used with local links.") + unwrapString p $ \str -> case parseUri str of + Just ("bbb",assembly_slug, room_slug) + | "/" `isPrefixOf` room_slug && T.length room_slug >= 2 -> do + let link = "https://rc3.world/assembly/"<>assembly_slug<>"/bbb"<>room_slug + dependsOn (Link link) + setProperty "openWebsite" link + setProperty "silent" (BoolProp True) + setProperty "openWebsitePolicy" + ("fullscreen;camera;microphone;display-capture" :: Text) + _ -> complain "the \"bbbRoom\" property must take a link of the form bbb://assembly_slug/room_slug." "bbbTrigger" -> do removeProperty "bbbTrigger" requireProperty "bbbRoom" |