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/CheckMap.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/CheckMap.hs') diff --git a/lib/CheckMap.hs b/lib/CheckMap.hs index aa4616a..258b6bb 100644 --- a/lib/CheckMap.hs +++ b/lib/CheckMap.hs @@ -33,7 +33,7 @@ import LintConfig (LintConfig (..), LintConfig') import LintWriter (LintResult, invertLintResult, resultToAdjusted, resultToBadges, resultToDeps, resultToLints, resultToOffers, - runLintWriter, resultToCWs) + runLintWriter, resultToCWs, resultToJitsis) import Properties (checkLayer, checkMap, checkTileset) import System.FilePath (takeFileName) import Types (Dep (MapLink), @@ -64,6 +64,8 @@ data MapResult (kind :: ResultKind) = MapResult -- ^ badges that can be found on this map , mapresultCWs :: [Text] -- ^ collected CWs that apply to this map + , mapresultJitsis :: [Text] + -- ^ all jitsi room slugs mentioned in this map , mapresultGeneral :: [Hint] -- ^ general-purpose lints that didn't fit anywhere else } deriving (Generic) @@ -105,7 +107,7 @@ shrinkMapResult !res = res { mapresultAdjusted = () } -- layers upwards in the file hierarchy loadAndLintMap :: LintConfig' -> FilePath -> Int -> IO (Maybe (MapResult Full)) loadAndLintMap config path depth = loadTiledmap path <&> \case - Left err -> Just (MapResult mempty mempty mempty mempty Nothing mempty mempty + Left err -> Just (MapResult mempty mempty mempty mempty Nothing mempty mempty mempty [ Hint Fatal . toText $ path <> ": Fatal: " <> err ]) @@ -127,6 +129,8 @@ runLinter isMain config@LintConfig{..} tiledmap depth = MapResult , mapresultProvides = concatMap resultToOffers layer , mapresultAdjusted = Just adjustedMap , mapresultCWs = resultToCWs generalResult + , mapresultJitsis = concatMap resultToJitsis tileset + <> concatMap resultToJitsis layer , mapresultBadges = concatMap resultToBadges layer <> resultToBadges generalResult } -- cgit v1.2.3