From 92945f9e855284534e103e4f29e069101033a62c Mon Sep 17 00:00:00 2001 From: stuebinm Date: Wed, 6 Apr 2022 18:05:42 +0200 Subject: linter: collect jitsi rooms of maps --- lib/LintWriter.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/LintWriter.hs') diff --git a/lib/LintWriter.hs b/lib/LintWriter.hs index 87bad02..afcec65 100644 --- a/lib/LintWriter.hs +++ b/lib/LintWriter.hs @@ -40,7 +40,7 @@ module LintWriter , lintConfig -- * adjust the linter's context , adjust - ,offersCWs,resultToCWs) where + ,offersCWs,resultToCWs,offersJitsi,resultToJitsis) where import Universum @@ -126,6 +126,9 @@ resultToCWs :: LintResult a -> [Text] resultToCWs (LinterState a) = fold $ mapMaybe lintToCW $ fst a where lintToCW = \case (CW cw) -> Just cw; _ -> Nothing +resultToJitsis :: LintResult a -> [Text] +resultToJitsis (LinterState a) = mapMaybe lintToJitsi $ fst a + where lintToJitsi = \case (Jitsi room) -> Just room; _ -> Nothing -- | convert a lint result into a flat list of lints resultToLints :: LintResult a -> [Lint] @@ -160,6 +163,9 @@ offersBadge badge = tell' $ Badge badge offersCWs :: [Text] -> LintWriter a offersCWs = tell' . CW +offersJitsi :: Text -> LintWriter a +offersJitsi = tell' . Jitsi + -- | get the context as it was initially, without any modifications askContext :: LintWriter' a a -- cgit v1.2.3