From 069b9efb4ae81a8845c4f41a4a81de721968b90f Mon Sep 17 00:00:00 2001 From: Philipp Balzarek Date: Thu, 18 Sep 2014 00:29:27 +0200 Subject: [PATCH] add lens for onPresenceChange --- source/Network/Xmpp/Lens.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/Network/Xmpp/Lens.hs b/source/Network/Xmpp/Lens.hs index 8e8d35a..b7339b8 100644 --- a/source/Network/Xmpp/Lens.hs +++ b/source/Network/Xmpp/Lens.hs @@ -94,6 +94,7 @@ module Network.Xmpp.Lens , sessionStanzaIDsL , ensableRosterL , pluginsL + , onPresenceChangeL -- ** IM -- *** Roster -- **** 'Roster' @@ -152,6 +153,7 @@ import Network.TLS as TLS import Network.Xmpp.Concurrent.Types import Network.Xmpp.IM.Message import Network.Xmpp.IM.Presence +import Network.Xmpp.IM.PresenceTracker.Types import Network.Xmpp.IM.Roster.Types import Network.Xmpp.Types @@ -538,6 +540,11 @@ pluginsL :: Lens SessionConfiguration [Plugin] pluginsL inj sc@SessionConfiguration{plugins = x} = (\x' -> sc{plugins = x'}) <$> inj x +onPresenceChangeL :: Lens SessionConfiguration (Maybe ( Jid -> PeerStatus + -> PeerStatus -> IO ())) +onPresenceChangeL inj sc@SessionConfiguration{onPresenceChange = x} + = (\x' -> sc{onPresenceChange = x'}) <$> inj x + -- | Access clientServerIdentification inside tlsParams inside streamConfiguration tlsServerIdentificationL :: Lens SessionConfiguration (String, BS.ByteString) tlsServerIdentificationL = streamConfigurationL