Logo Search packages:      
Sourcecode: gabber version File versions  Download package

void Session::queryNamespace ( const string &  nspace,
ElementCallbackFunc  f,
const string &  to = "" 

Query a namespace on a specific JabberID. The callback will be called once a response to the namespace query is received.

nspace The namespace to query.
f The function to call.
to The JabberID to query. If empty, it queries the server this Session is connected to.

Definition at line 186 of file jabberoo-session.cc.

References judo::Element::addElement(), getNextID(), judo::Element::putAttrib(), and judo::Element::toString().

Referenced by jabberoo::Roster::deleteUser().

     // Get a unique ID
     string id = getNextID();

     // Construct a query for this namespace
     Element iq("iq");
     iq.putAttrib("type", "get");
     iq.putAttrib("id", id);
     if (!to.empty())
        iq.putAttrib("to", to);
     iq.addElement("query")->putAttrib("xmlns", nspace);

     // Register a callback for this IQ
     _Callbacks.insert(make_pair(id, f));

     // Transmit the IQ
     *this << iq.toString().c_str();

Generated by  Doxygen 1.6.0   Back to index