summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorstuebinm2021-11-30 00:17:34 +0100
committerstuebinm2021-11-30 00:17:34 +0100
commit72d66169ecef657eae7833c19e80b5e115d4a4b1 (patch)
treed86e7c6b26127959a45d5203a3bb01f346ad1e7d /lib
parentc71cf47ee509353af88223850a1bae4db5f3393d (diff)
rudimentary emulation of bbbRoom etc.
("rudimentary" since for now the best it can do is just replacing / prepending urls; presumably, it should also do a sanity check or something of the like)
Diffstat (limited to '')
-rw-r--r--lib/Properties.hs30
1 files changed, 26 insertions, 4 deletions
diff --git a/lib/Properties.hs b/lib/Properties.hs
index 85ef7c0..35cc155 100644
--- a/lib/Properties.hs
+++ b/lib/Properties.hs
@@ -153,7 +153,7 @@ checkLayerProperty p@(Property name _value) = case name of
>>= setProperty "jitsiRoomAdminTag"
uselessEmptyLayer
unwrapString' p
- $ suggestProperty $ Property "jitsiTrigger" (StrProp "onaction")
+ $ suggestProperty $ Property "jitsiTrigger" "onaction"
"jitsiTrigger" -> do
isString p
unlessHasProperty "jitsiTriggerMessage"
@@ -169,6 +169,30 @@ checkLayerProperty p@(Property name _value) = case name of
"jitsiInterfaceConfig" -> isForbidden
"jitsiWidth" ->
isIntInRange 0 100 p
+ "bbbRoom" -> do
+ removeProperty "bbbRoom"
+ unwrapURI (Proxy @"bbb") p
+ (\link -> do
+ dependsOn (Link link)
+ setProperty "openWebsite" link
+ setProperty "openWebsitePolicy"
+ ("fullscreen;camera;microphone;display-capture" :: Text)
+ )
+ (const $ complain "property \"bbbRoom\" cannot be used with local links.")
+ "bbbTrigger" -> do
+ removeProperty "bbbTrigger"
+ requireProperty "bbbRoom"
+ unwrapString p
+ (setProperty "openWebsiteTrigger")
+ unlessHasProperty "bbbTriggerMessage" $ do
+ suggest "set \"bbbTriggerMessage\" to a custom message to overwrite the default \"press SPACE to enter the bbb room\""
+ setProperty "openWebsiteTriggerMessage"
+ ("press SPACE to enter bbb room" :: Text)
+ "bbbTriggerMessage" -> do
+ removeProperty "bbbTriggerMessage"
+ requireProperty "bbbRoom"
+ unwrapString p
+ (setProperty "openWebsiteTriggerMessage")
"playAudio" -> do
uselessEmptyLayer
unwrapLink p $ \link -> if "https://" `isPrefixOf` link
@@ -196,9 +220,7 @@ checkLayerProperty p@(Property name _value) = case name of
"openWebsiteTriggerMessage" -> do
isString p
requireProperty "openWebsiteTrigger"
- "openWebsitePolicy" -> do
- isString p
- requireProperty "openWebsite"
+ "openWebsitePolicy" -> isForbidden
"openWebsiteAllowApi" -> isForbidden
"openTab" -> do
isString p