From bc11cea4c013e655e17b4e814e1bb5a216f82794 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 24 Nov 2015 19:22:35 -0500 Subject: [PATCH] When join room invited to, remove invite --- Main.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Main.hs b/Main.hs index 17bb332..e00eb5d 100644 --- a/Main.hs +++ b/Main.hs @@ -141,6 +141,10 @@ componentStanza db toVitelity _ (ReceivedPresence p@(Presence { presenceType = P [x] <- isNamed (fromString "{http://jabber.org/protocol/muc#user}x") =<< presencePayloads p, [status] <- isNamed (fromString "{http://jabber.org/protocol/muc#user}status") =<< elementChildren x, (_:_) <- code110 status = do + existingInvite <- tcGetJID db tel "invited" + when (existingInvite == Just bareMUC) $ do + True <- TC.runTCM $ TC.out db $ tcKey tel "invited" + return () tcPutJID db tel "joined" from writeStanzaChan toVitelity $ mkSMS tel (mconcat [fromString "* You have joined ", bareMUC, fromString " as ", roomNick]) where -- 2.38.4