~singpolyma/cheogram

8d4351cbcae3d7e97e4952e28fcdd9a74217d423 — Stephen Paul Weber 8 years ago 7ca5135
Filter out bogus vitelity crap

Closes #28
1 files changed, 3 insertions(+), 1 deletions(-)

M Main.hs
M Main.hs => Main.hs +3 -1
@@ 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