<test-history test='Presence 4 (c2s)'>
<OUTPUT test='Subscription receive'>
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' to='test-d' version='1.0'/>
</OUTPUT>
<INPUT test='Subscription receive'>
<stream:stream xmlns:stream="http://etherx.jabber.org/streams" xml:lang="en" id="96370ebe-da0c-4d79-915a-04e5ed3dc005" version="1.0" from="test-d" xmlns="jabber:client"/>
</INPUT>
<INPUT test='Subscription receive'>
<stream:features><ver xmlns="urn:xmpp:features:rosterver"/><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism></mechanisms><register xmlns="http://jabber.org/features/iq-register"/><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><auth xmlns="http://jabber.org/features/iq-auth"/></stream:features>
</INPUT>
<OUTPUT test='Subscription receive'>
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGFsbC14bXBwLXRlc3QAYWxsLXhtcHAtdGVzdC1wYXNzd29yZA==</auth>
</OUTPUT>
<INPUT test='Subscription receive'>
<success xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/>
</INPUT>
<OUTPUT test='Subscription receive'>
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' to='test-d' version='1.0'>
</OUTPUT>
<INPUT test='Subscription receive'>
<stream:stream xmlns:stream="http://etherx.jabber.org/streams" xml:lang="en" id="96370ebe-da0c-4d79-915a-04e5ed3dc005" version="1.0" from="test-d" xmlns="jabber:client"/>
</INPUT>
<INPUT test='Subscription receive'>
<stream:features><ver xmlns="urn:xmpp:features:rosterver"/><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/><register xmlns="http://jabber.org/features/iq-register"/><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/></stream:features>
</INPUT>
<OUTPUT test='Subscription receive'>
<iq type='set' id='bind1'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><resource>def-user-resource</resource></bind></iq>
</OUTPUT>
<INPUT test='Subscription receive'>
<iq type="result" to="all-xmpp-test@test-d/def-user-resource" id="bind1" xmlns="jabber:client"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><jid>all-xmpp-test@test-d/def-user-resource</jid></bind></iq>
</INPUT>
<OUTPUT test='Subscription receive'>
<iq id="sub-rec-1" type="get">
<query xmlns="jabber:iq:roster"/>
</iq>
</OUTPUT>
<INPUT test='Subscription receive'>
<iq type="result" to="all-xmpp-test@test-d/def-user-resource" id="sub-rec-1" xmlns="jabber:client"><query xmlns="jabber:iq:roster"/></iq>
</INPUT>
<INPUT test='Subscription receive'>
<iq type="set" to="all-xmpp-test@test-d/def-user-resource" id="tig3" xmlns="jabber:client"><query xmlns="jabber:iq:roster"><item name="dynrost" subscription="both" jid="dynrost@test-d"><group>test group</group></item></query></iq>
</INPUT>
<OUTPUT test='Subscription receive'>
<iq id="tig3" type="result"/>
</OUTPUT>
<OUTPUT test='Subscription receive'>
<presence id="sub-rec-2" type="available"/>
</OUTPUT>
<INPUT test='Subscription receive'>
<presence type="available" to="all-xmpp-test@test-d" id="sub-rec-2" from="all-xmpp-test@test-d/def-user-resource" xmlns="jabber:client"/>
</INPUT>
<OUTPUT test='Subscription send'>
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' to='test-d' version='1.0'/>
</OUTPUT>
<INPUT test='Subscription send'>
<stream:stream xmlns:stream="http://etherx.jabber.org/streams" xml:lang="en" id="544a1104-c791-4d18-988f-1180b9a58b89" version="1.0" from="test-d" xmlns="jabber:client"/>
</INPUT>
<INPUT test='Subscription send'>
<stream:features><ver xmlns="urn:xmpp:features:rosterver"/><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism></mechanisms><register xmlns="http://jabber.org/features/iq-register"/><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><auth xmlns="http://jabber.org/features/iq-auth"/></stream:features>
</INPUT>
<OUTPUT test='Subscription send'>
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGFkbWluAHN0YXRz</auth>
</OUTPUT>
<INPUT test='Subscription send'>
<success xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/>
</INPUT>
<OUTPUT test='Subscription send'>
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' to='test-d' version='1.0'>
</OUTPUT>
<INPUT test='Subscription send'>
<stream:stream xmlns:stream="http://etherx.jabber.org/streams" xml:lang="en" id="544a1104-c791-4d18-988f-1180b9a58b89" version="1.0" from="test-d" xmlns="jabber:client"/>
</INPUT>
<INPUT test='Subscription send'>
<stream:features><ver xmlns="urn:xmpp:features:rosterver"/><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/><register xmlns="http://jabber.org/features/iq-register"/><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/></stream:features>
</INPUT>
<OUTPUT test='Subscription send'>
<iq type='set' id='bind1'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><resource>def-user-resource</resource></bind></iq>
</OUTPUT>
<INPUT test='Subscription send'>
<iq type="result" to="admin@test-d/def-user-resource" id="bind1" xmlns="jabber:client"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><jid>admin@test-d/def-user-resource</jid></bind></iq>
</INPUT>
<OUTPUT test='Subscription send'>
<iq id="sub-send-1" type="get">
<query xmlns="jabber:iq:roster"/>
</iq>
</OUTPUT>
<INPUT test='Subscription send'>
<iq type="result" to="admin@test-d/def-user-resource" id="sub-send-1" xmlns="jabber:client"><query xmlns="jabber:iq:roster"/></iq>
</INPUT>
<INPUT test='Subscription send'>
<iq type="set" to="admin@test-d/def-user-resource" id="tig3" xmlns="jabber:client"><query xmlns="jabber:iq:roster"><item name="dynrost" subscription="both" jid="dynrost@test-d"><group>test group</group></item></query></iq>
</INPUT>
<OUTPUT test='Subscription send'>
<iq id="tig3" type="result"/>
</OUTPUT>
<OUTPUT test='Subscription send'>
<presence id="sub-send-2" type="available"/>
</OUTPUT>
<INPUT test='Subscription send'>
<presence type="available" to="admin@test-d" id="sub-send-2" from="admin@test-d/def-user-resource" xmlns="jabber:client"/>
</INPUT>
<OUTPUT test='Subscription send'>
<presence to="all-xmpp-test@test-d" id="sub-send-3" type="subscribe"/>
</OUTPUT>
<INPUT test='Subscription send'>
<iq type="set" to="admin@test-d/def-user-resource" id="rsttig4" xmlns="jabber:client"><query ver="398cacd6cb1321844bf5d7013d3fb3c8" xmlns="jabber:iq:roster"><item ask="subscribe" jid="all-xmpp-test@test-d" subscription="none" name="all-xmpp-test"/></query></iq>
</INPUT>
<INPUT test='Subscription receive'>
<presence type="subscribe" to="all-xmpp-test@test-d" id="sub-send-3" from="admin@test-d" xmlns="jabber:client"/>
</INPUT>
<OUTPUT test='Subscription receive'>
<presence to="admin@test-d" id="sub-rec-3" type="subscribed"/>
</OUTPUT>
<INPUT test='Subscription receive'>
<iq type="set" to="all-xmpp-test@test-d/def-user-resource" id="rsttig4" xmlns="jabber:client"><query ver="398cacd6cb1321844bf5d7013d3fb3c8" xmlns="jabber:iq:roster"><item name="admin" subscription="from" jid="admin@test-d"/></query></iq>
</INPUT>
<OUTPUT test='Subscription receive'>
<presence to="admin@test-d" id="sub-rec-4" type="subscribe"/>
</OUTPUT>
<INPUT test='Subscription receive'>
<iq type="set" to="all-xmpp-test@test-d/def-user-resource" id="rsttig5" xmlns="jabber:client"><query ver="398cacd6cb1321844bf5d7013d3fb3c8" xmlns="jabber:iq:roster"><item ask="subscribe" jid="admin@test-d" subscription="from" name="admin"/></query></iq>
</INPUT>
<INPUT test='Subscription send'>
<presence type="subscribed" to="admin@test-d" id="sub-rec-3" from="all-xmpp-test@test-d" xmlns="jabber:client"/>
</INPUT>
<INPUT test='Subscription send'>
<iq type="set" to="admin@test-d/def-user-resource" id="rsttig5" xmlns="jabber:client"><query ver="398cacd6cb1321844bf5d7013d3fb3c8" xmlns="jabber:iq:roster"><item name="all-xmpp-test" subscription="to" jid="all-xmpp-test@test-d"/></query></iq>
</INPUT>
<INPUT test='Subscription send'>
<presence type="available" to="admin@test-d" id="sub-rec-2" from="all-xmpp-test@test-d/def-user-resource" xmlns="jabber:client"/>
</INPUT>
<INPUT test='Subscription send'>
<presence type="subscribe" to="admin@test-d" id="sub-rec-4" from="all-xmpp-test@test-d" xmlns="jabber:client"/>
</INPUT>
<OUTPUT test='Subscription send'>
<presence to="all-xmpp-test@test-d" id="sub-send-4" type="subscribed"/>
</OUTPUT>
<INPUT test='Subscription send'>
<iq type="set" to="admin@test-d/def-user-resource" id="rsttig6" xmlns="jabber:client"><query ver="398cacd6cb1321844bf5d7013d3fb3c8" xmlns="jabber:iq:roster"><item name="all-xmpp-test" subscription="both" jid="all-xmpp-test@test-d"/></query></iq>
</INPUT>
<OUTPUT test='Subscription send'>
<iq id="sub-send-5" type="get">
<query xmlns="jabber:iq:roster"/>
</iq>
</OUTPUT>
<INPUT test='Subscription send'>
<iq type="result" to="admin@test-d/def-user-resource" id="sub-send-5" xmlns="jabber:client"><query xmlns="jabber:iq:roster"><item name="all-xmpp-test" subscription="both" jid="all-xmpp-test@test-d"/></query></iq>
</INPUT>
<INPUT test='Subscription receive'>
<presence type="subscribed" to="all-xmpp-test@test-d" id="sub-send-4" from="admin@test-d" xmlns="jabber:client"/>
</INPUT>
<INPUT test='Subscription receive'>
<iq type="set" to="all-xmpp-test@test-d/def-user-resource" id="rsttig6" xmlns="jabber:client"><query ver="398cacd6cb1321844bf5d7013d3fb3c8" xmlns="jabber:iq:roster"><item name="admin" subscription="both" jid="admin@test-d"/></query></iq>
</INPUT>
<INPUT test='Subscription receive'>
<presence type="available" to="all-xmpp-test@test-d" id="sub-send-2" from="admin@test-d/def-user-resource" xmlns="jabber:client"/>
</INPUT>
<OUTPUT test='Subscription receive'>
<iq id="sub-rec-5" type="get">
<query xmlns="jabber:iq:roster"/>
</iq>
</OUTPUT>
<INPUT test='Subscription receive'>
<iq type="result" to="all-xmpp-test@test-d/def-user-resource" id="sub-rec-5" xmlns="jabber:client"><query xmlns="jabber:iq:roster"><item name="admin" subscription="both" jid="admin@test-d"/></query></iq>
</INPUT>
<INPUT test='Subscription send'>
<iq type="set" to="admin@test-d/def-user-resource" id="tig7" xmlns="jabber:client"><query xmlns="jabber:iq:roster"><item name="dynrost" subscription="both" jid="dynrost@test-d"><group>test group</group></item></query></iq>
</INPUT>
<INPUT test='Subscription receive'>
<iq type="set" to="all-xmpp-test@test-d/def-user-resource" id="tig7" xmlns="jabber:client"><query xmlns="jabber:iq:roster"><item name="dynrost" subscription="both" jid="dynrost@test-d"><group>test group</group></item></query></iq>
</INPUT>
<INPUT test='Subscription receive'>
<presence type="unavailable" to="all-xmpp-test@test-d" id="sub-send-2" from="admin@test-d/def-user-resource" xmlns="jabber:client"/>
</INPUT>

</test-history>