~singpolyma/cheogram

7ca51356988a99d0ccb88b5362bd13a570e741b9 — Stephen Paul Weber 6 years ago a94a72f
Say you are not in a group in reply to /who

Closes #31
1 files changed, 7 insertions(+), 2 deletions(-)

M Main.hs
M Main.hs => Main.hs +7 -2
@@ 917,11 917,16 @@ processSMS db toVitelity toComponent componentHost conferenceServers tel txt = d
			let snick = T.unpack nick
			let room = maybe "" (T.unpack . bareTxt) existingRoom
			presence <- fmap (fromMaybe [] . (readZ =<<)) (TC.runTCM $ TC.get db ("presence\0" <> room))
			writeStanzaChan toVitelity $ mkSMS tel $ fromString $ mconcat [
			let presence' = filter (/= snick) $ map f presence
			if null presence' then
				writeStanzaChan toVitelity $ mkSMS tel $ fromString $
					"You are not joined to a group. Reply with /help to learn more"
			else
				writeStanzaChan toVitelity $ mkSMS tel $ fromString $ mconcat [
					"You are joined to ", room,
					" as ", snick,
					" along with\n",
					intercalate ", " (filter (/= snick) $ map f presence)
					intercalate ", " presence'
				]
		Just List -> do
			bookmarks <- fmap (fromMaybe [] . (readZ =<<)) (TC.runTCM $ TC.get db (tcKey tel "bookmarks"))