OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/jingle_glue/iq_request.h" | 5 #include "remoting/jingle_glue/iq_request.h" |
6 | 6 |
7 #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" | 7 #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" |
8 #include "third_party/libjingle/source/talk/xmpp/constants.h" | 8 #include "third_party/libjingle/source/talk/xmpp/constants.h" |
9 | 9 |
10 namespace remoting { | 10 namespace remoting { |
11 | 11 |
12 // static | 12 // static |
13 buzz::XmlElement* IqRequest::MakeIqStanza(const std::string& type, | 13 buzz::XmlElement* IqRequest::MakeIqStanza(const std::string& type, |
14 const std::string& addressee, | 14 const std::string& addressee, |
15 buzz::XmlElement* iq_body, | 15 buzz::XmlElement* iq_body) { |
16 const std::string& id) { | |
17 buzz::XmlElement* stanza = new buzz::XmlElement(buzz::QN_IQ); | 16 buzz::XmlElement* stanza = new buzz::XmlElement(buzz::QN_IQ); |
18 stanza->AddAttr(buzz::QN_TYPE, type); | 17 stanza->AddAttr(buzz::QN_TYPE, type); |
19 if (!addressee.empty()) | 18 if (!addressee.empty()) |
20 stanza->AddAttr(buzz::QN_TO, addressee); | 19 stanza->AddAttr(buzz::QN_TO, addressee); |
21 stanza->AddAttr(buzz::QN_ID, id); | |
22 stanza->AddElement(iq_body); | 20 stanza->AddElement(iq_body); |
23 return stanza; | 21 return stanza; |
24 } | 22 } |
25 | 23 |
26 } // namespace remoting | 24 } // namespace remoting |
OLD | NEW |