Browse Source

changed JID field names to conform to RFC 6120

master
Philipp Balzarek 14 years ago
parent
commit
ef63f12952
  1. 6
      src/Network/XMPP/Types.hs
  2. 6
      src/Tests.hs

6
src/Network/XMPP/Types.hs

@ -73,11 +73,11 @@ instance IsString StanzaId where
-- @From@ is a readability type synonym for @Address@. -- @From@ is a readability type synonym for @Address@.
-- | Jabber ID (JID) datatype -- | Jabber ID (JID) datatype
data JID = JID { node :: Maybe Text data JID = JID { localpart :: Maybe Text
-- ^ Account name -- ^ Account name
, domain :: Text , domainpart :: Text
-- ^ Server adress -- ^ Server adress
, resource :: Maybe Text , resourcepart :: Maybe Text
-- ^ Resource name -- ^ Resource name
} }

6
src/Tests.hs

@ -89,11 +89,11 @@ runMain debug number = do
withConnection $ do withConnection $ do
xmppConnect "localhost" "species64739.dyndns.org" xmppConnect "localhost" "species64739.dyndns.org"
xmppStartTLS exampleParams xmppStartTLS exampleParams
saslResponse <- xmppSASL (fromJust $ node we) "pwd" saslResponse <- xmppSASL (fromJust $ localpart we) "pwd"
case saslResponse of case saslResponse of
Right _ -> return () Right _ -> return ()
Left e -> error e Left e -> error e
xmppThreadedBind (resource we) xmppThreadedBind (resourcepart we)
withConnection $ xmppSession withConnection $ xmppSession
debug' "session standing" debug' "session standing"
sendPresence presenceOnline sendPresence presenceOnline
@ -101,7 +101,7 @@ runMain debug number = do
forkXMPP iqResponder forkXMPP iqResponder
when active . void . forkXMPP $ do when active . void . forkXMPP $ do
forM [1..10] $ \count -> do forM [1..10] $ \count -> do
let message = Text.pack . show $ node we let message = Text.pack . show $ localpart we
let payload = Payload count (even count) (Text.pack $ show count) let payload = Payload count (even count) (Text.pack $ show count)
let body = pickleElem payloadP payload let body = pickleElem payloadP payload
Right answer <- sendIQ' (Just them) Get Nothing body Right answer <- sendIQ' (Just them) Get Nothing body

Loading…
Cancel
Save