~singpolyma/cheogram

a66fee0b203dc6adf6b7f478451192ec032d26f5 — Stephen Paul Weber 3 years ago 2a1d74e
Suppress welcome message for token sends
1 files changed, 3 insertions(+), 3 deletions(-)

M Main.hs
M Main.hs => Main.hs +3 -3
@@ 1402,9 1402,9 @@ processSMS db componentJid conferenceServers smsJid cheoJid txt = do
		Just (AddJid addjid) -> do
			token <- genToken 100
			True <- TC.runTCM $ TC.put db (T.unpack (bareTxt addjid) ++ "\0addtoken") (show (formatJID cheoJid, token))
			return [
					mkStanzaRec $ mkSMS componentJid smsJid (s"CHEOGRAM" ++ token)
				]
			return $ case parseJID (formatJID componentJid ++ s"/token") of
				Just sendFrom -> [mkStanzaRec $ mkSMS sendFrom smsJid (s"CHEOGRAM" ++ token)]
				Nothing -> []
		Just (DelJid deljid) -> do
			-- Deleting a JID is much less dangerous since in the worst case SMS just go to the actual phone number
			TC.runTCM $ TC.out db (T.unpack (bareTxt deljid) ++ "\0cheoJid")