From 8a0a463f1e45c990fb417c3d08f9f8e7e5643212 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Sat, 19 Mar 2022 16:50:37 +0100 Subject: linter: remove bbb-simulating code --- Readme.md | 6 ++---- lib/Properties.hs | 34 +++------------------------------- 2 files changed, 5 insertions(+), 35 deletions(-) diff --git a/Readme.md b/Readme.md index faba39f..138c2f3 100644 --- a/Readme.md +++ b/Readme.md @@ -131,10 +131,8 @@ For now there are three types of such rules: In case an URI is encountered and there is no applicable rule, it will be rejected (note that this means you'll have to explicitly allow `https://` for links!) -There are currently four possible scopes: `map` applies to tiled map links -(i.e. `exitUrl`), `website` to `openWebsite`, `audio` to `playAudio`, and -`bbb` to Big Blue Button rooms (though that last one may be changed again, -depending on the bbb deployment in use). +There are currently three possible scopes: `map` applies to tiled map links +(i.e. `exitUrl`), `website` to `openWebsite`, `audio` to `playAudio`. ## Output diff --git a/lib/Properties.hs b/lib/Properties.hs index 3100b3a..63cea1f 100644 --- a/lib/Properties.hs +++ b/lib/Properties.hs @@ -63,8 +63,8 @@ knownObjectProperties = V.fromList knownTileLayerProperites :: Vector Text knownTileLayerProperites = V.fromList - [ "jitsiRoom", "jitsiTrigger", "jitsiTriggerMessage", "jitsiWidth", "bbbRoom" - , "bbbTrigger", "bbbTriggerMessage", "playAudio", "audioLoop", "audioVolumne" + [ "jitsiRoom", "jitsiTrigger", "jitsiTriggerMessage", "jitsiWidth" + , "playAudio", "audioLoop", "audioVolumne" , "openWebsite", "openWebsiteTrigger", "openWebsiteTriggerMessage", "openTag" , "exitUrl", "startLayer", "silent", "getBadge", "zone", "name", "doorVariable" , "bindVariable", "bellVariable", "code", "openTriggerMessage" @@ -146,7 +146,7 @@ checkMapProperty p@(Property name _) = case name of not ( "%" `isInfixOf` str) && not ( "@" `isInfixOf` str)) $ forbid "only scripts hosted on static.rc3.world are allowed." - | name `elem` ["jitsiRoom", "bbbRoom", "playAudio", "openWebsite" + | name `elem` ["jitsiRoom", "playAudio", "openWebsite" , "url", "exitUrl", "silent", "getBadge"] -> complain $ "property " <> name <> " should be set on layers, not the map directly" @@ -375,34 +375,6 @@ checkTileThing removeExits p@(Property name _value) = case name of requireProperty "jitsiTrigger" "jitsiWidth" -> isIntInRange 0 100 p - "bbbRoom" -> do - 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/2021/room"<>room_slug - dependsOn (Link link) - setProperty "openTab" 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" - unwrapString p - (setProperty "openWebsiteTrigger") - unlessHasProperty "bbbTriggerMessage" $ do - setProperty "openWebsiteTriggerMessage" - ("press SPACE to enter bbb room in a new tab" :: Text) - suggest "set \"bbbTriggerMessage\" to a custom message to overwrite the\ - \default \"press SPACE to enter the bbb room\"" - "bbbTriggerMessage" -> do - removeProperty "bbbTriggerMessage" - requireProperty "bbbRoom" - unwrapString p - (setProperty "openWebsiteTriggerMessage") "playAudio" -> do uselessEmptyLayer unwrapURI (Proxy @"audio") p -- cgit v1.2.3