OLD | NEW |
(Empty) | |
| 1 // Copyright 2004 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Fires a disco items query, such as the following example: |
| 6 // |
| 7 // <iq type='get' |
| 8 // from='foo@gmail.com/asdf' |
| 9 // to='bar@google.com' |
| 10 // id='1234'> |
| 11 // <query xmlns=' http://jabber.org/protocol/disco#items' |
| 12 // node='blah '/> |
| 13 // </iq> |
| 14 // |
| 15 // Sample response: |
| 16 // |
| 17 // <iq type='result' |
| 18 // from=' hendriks@google.com' |
| 19 // to='rsturgell@google.com/asdf' |
| 20 // id='1234'> |
| 21 // <query xmlns=' http://jabber.org/protocol/disco#items ' |
| 22 // node='blah'> |
| 23 // <item something='somethingelse'/> |
| 24 // </query> |
| 25 // </iq> |
| 26 |
| 27 |
| 28 #ifndef WEBRTC_LIBJINGLE_XMPP_DISCOITEMSQUERYTASK_H_ |
| 29 #define WEBRTC_LIBJINGLE_XMPP_DISCOITEMSQUERYTASK_H_ |
| 30 |
| 31 #include <string> |
| 32 #include <vector> |
| 33 |
| 34 #include "third_party/xmpp/iqtask.h" |
| 35 |
| 36 namespace buzz { |
| 37 |
| 38 struct DiscoItem { |
| 39 std::string jid; |
| 40 std::string node; |
| 41 std::string name; |
| 42 }; |
| 43 |
| 44 class DiscoItemsQueryTask : public IqTask { |
| 45 public: |
| 46 DiscoItemsQueryTask(XmppTaskParentInterface* parent, |
| 47 const Jid& to, const std::string& node); |
| 48 |
| 49 sigslot::signal1<std::vector<DiscoItem> > SignalResult; |
| 50 |
| 51 private: |
| 52 static XmlElement* MakeRequest(const std::string& node); |
| 53 virtual void HandleResult(const XmlElement* result); |
| 54 static bool ParseItem(const XmlElement* element, DiscoItem* item); |
| 55 }; |
| 56 |
| 57 } // namespace buzz |
| 58 |
| 59 #endif // WEBRTC_LIBJINGLE_XMPP_DISCOITEMSQUERYTASK_H_ |
OLD | NEW |