From 8d4351cbcae3d7e97e4952e28fcdd9a74217d423 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 2 Feb 2016 17:21:49 -0500 Subject: [PATCH] Filter out bogus vitelity crap Closes #28 --- Main.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Main.hs b/Main.hs index 8bf4652..c124cdd 100644 --- a/Main.hs +++ b/Main.hs @@ -750,7 +750,7 @@ stripCIPrefix prefix str where (prefix', rest) = T.splitAt (T.length $ CI.original prefix) str -data Command = Help | Create Text | Join JID | JoinInvited | JoinInvitedWrong | Send Text | Who | List | Leave | InviteCmd JID | SetNick Text | Whisper JID Text +data Command = Help | Create Text | Join JID | JoinInvited | JoinInvitedWrong | Send Text | Who | List | Leave | InviteCmd JID | SetNick Text | Whisper JID Text | VitelityBogus Text deriving (Show, Eq) parseCommand txt room nick componentHost @@ -777,6 +777,7 @@ parseCommand txt room nick componentHost | citxt == fromString "/who" = Just Who | citxt == fromString "/list" = Just List | citxt == fromString "/help" = Just Help + | citxt == fromString "You are not authorized to send SMS messages." = Just $ VitelityBogus txt | otherwise = Just $ Send txt where citxt = CI.mk txt @@ -968,6 +969,7 @@ processSMS db toVitelity toComponent componentHost conferenceServers tel txt = d "Leave group: /leave\n", "More info: http://cheogram.com" ] + Just (VitelityBogus txt) -> putStrLn $ fromString "Bogus Vitelity message: " <> txt Nothing -> writeStanzaChan toVitelity $ mkSMS tel (fromString "You sent an invalid message") viteltiy db chunks toVitelity toComponent componentHost conferenceServers = do -- 2.45.2