summaryrefslogtreecommitdiffstats
path: root/remoting/jingle_glue/xmpp_iq_request.cc
diff options
context:
space:
mode:
Diffstat (limited to 'remoting/jingle_glue/xmpp_iq_request.cc')
-rw-r--r--remoting/jingle_glue/xmpp_iq_request.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/remoting/jingle_glue/xmpp_iq_request.cc b/remoting/jingle_glue/xmpp_iq_request.cc
index 7e07665..b8057c3 100644
--- a/remoting/jingle_glue/xmpp_iq_request.cc
+++ b/remoting/jingle_glue/xmpp_iq_request.cc
@@ -25,14 +25,20 @@ XmppIqRequest::~XmppIqRequest() {
Unregister();
}
-void XmppIqRequest::SendIq(buzz::XmlElement* stanza) {
+void XmppIqRequest::SendIq(const std::string& type,
+ const std::string& addressee,
+ buzz::XmlElement* iq_body) {
DCHECK_EQ(MessageLoop::current(), message_loop_);
// Unregister the handler if it is already registered.
Unregister();
- stanza->AddAttr(buzz::QN_ID, xmpp_client_->NextId());
- xmpp_client_->engine()->SendIq(stanza, this, &cookie_);
+ DCHECK_GT(type.length(), 0U);
+
+ scoped_ptr<buzz::XmlElement> stanza(MakeIqStanza(type, addressee, iq_body,
+ xmpp_client_->NextId()));
+
+ xmpp_client_->engine()->SendIq(stanza.get(), this, &cookie_);
}
void XmppIqRequest::set_callback(const ReplyCallback& callback) {