~singpolyma/cheogram

bc11cea4c013e655e17b4e814e1bb5a216f82794 — Stephen Paul Weber 8 years ago 173d731
When join room invited to, remove invite
1 files changed, 4 insertions(+), 0 deletions(-)

M Main.hs
M Main.hs => Main.hs +4 -0
@@ 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