From 9a5533c21327152ba2dcb9765924c5037f8f3af4 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Sun, 29 Nov 2015 14:55:07 -0500 Subject: [PATCH] Send "failed to join" message on MUC join error of any kind --- Main.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Main.hs b/Main.hs index 81aea50..5eeb1c2 100644 --- a/Main.hs +++ b/Main.hs @@ -206,6 +206,10 @@ componentStanza db toVitelity toComponent componentHost (ReceivedMessage (m@Mess } where resourceFrom = strResource <$> jidResource from +componentStanza _ toVitelity _ _ (ReceivedPresence p@(Presence { presenceType = PresenceError, presenceFrom = Just from, presenceTo = Just to })) + | Just tel <- strNode <$> jidNode to, + [_] <- isNamed (fromString "{http://jabber.org/protocol/muc}x") =<< presencePayloads p = + writeStanzaChan toVitelity $ mkSMS tel (fromString "* Failed to join " <> bareTxt from) componentStanza db toVitelity toComponent _ (ReceivedPresence p@(Presence { presenceType = PresenceAvailable, presenceFrom = Just from, presenceTo = Just to })) | Just tel <- strNode <$> jidNode to, [x] <- isNamed (fromString "{http://jabber.org/protocol/muc#user}x") =<< presencePayloads p, -- 2.38.5