diff options
author | stuebinm | 2021-12-21 21:40:10 +0100 |
---|---|---|
committer | stuebinm | 2021-12-21 21:40:10 +0100 |
commit | e8fca76246a313f743180408c5745cb050d1d1a6 (patch) | |
tree | b13e2975cf48add27cadee7644953b22fe6486ce | |
parent | 714ddd55d1cc6ef55941ecba1b0fdbce2f3193db (diff) |
check that bbbRoom contains a valid assembly_slug
-rw-r--r-- | lib/Properties.hs | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/Properties.hs b/lib/Properties.hs index dd680ea..f60758f 100644 --- a/lib/Properties.hs +++ b/lib/Properties.hs @@ -291,13 +291,18 @@ checkTileLayerProperty p@(Property name _value) = case name of removeProperty "bbbRoom" 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) + | "/" `isPrefixOf` room_slug + && T.length room_slug >= 2 -> do + assemblies <- lintConfig configAssemblies + if assembly_slug `elem` assemblies + then 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) + else complain $ prettyprint assembly_slug <> " is not a registered assembly and therefore cannot be used in `bbbUrl`." _ -> complain "the \"bbbRoom\" property must take a link of the form bbb://assembly_slug/room_slug." "bbbTrigger" -> do removeProperty "bbbTrigger" |