與服務器通信,當我面臨的一個問題網友:獲取使用Jabber(XMPP)
[request] <stream:stream to="chat.facebook.com" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" version="1.0">
[response] <?xml version="1.0"?><stream:stream id="0D752DF3" from="chat.facebook.com" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0" xml:lang="en"><stream:features><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>X-FACEBOOK-PLATFORM</mechanism><mechanism>DIGEST-MD5</mechanism></mechanisms></stream:features>
[request] <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="X-FACEBOOK-PLATFORM" />
[response] <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">[removed]</challenge>
[request] <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">[removed]</response>
[response] <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/>
[response] <?xml version="1.0"?><stream:stream id="4FC996C0" from="chat.facebook.com" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0" xml:lang="en"><stream:features><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/></stream:features>
[request] <iq type="set" id="1"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind" /></iq>
[response] <iq id="1" type="result"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><jid>-[removed]@chat.facebook.com/[removed]</jid></bind></iq>
[request] <iq type="set" id="2" to="chat.facebook.com"><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/></iq>
[response] <iq type="result" from="chat.facebook.com" id="2"><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/></iq>
[request] <iq type="get" id="3" from="-[removed]@chat.facebook.com/[removed]"><query xmlns="jabber:iq:roster"/></iq>
的問題是最後一個請求:
[request] <iq type="get" id="3" from="-[removed]@chat.facebook.com/[removed]"><query xmlns="jabber:iq:roster"/></iq>
其中,根據文獻[ ?],應該只返回在線用戶。但是,它會返回所有用戶朋友。 如何獲取/過濾僅限在線用戶?
你能告訴我使用哪一節你已經提取所有Facebook的在線用戶嗎? – Hunt 2012-01-28 12:44:46