gloox
1.0
|
This page contains information about upgrading gloox from an earlier version to the current one. It lists the API changes that were made and how to change your code to achieve the same (or better) functionality as with the earlier version.
1.1 Deprecated classes and functions
1.2 Removed classes and functions
1.3 Semantic Changes
Besides the changes detailed below, a major change is that the Stanza class now is an abstract base for more specialized Message , Presence , IQ , and Subscription classes. Therefore, PresenceHandler , MessageHandler , SubscriptionHandler , and IqHandler no longer take a Stanza* argument, but receive a pointer to the respective specialized class. Additionally, in a move to get away from unsafe pointers to safer references, these pointer-taking functions have been deprecated (but will continue to be available throughout the 1.0.x cycle). The recommended usage looks as follows:
Old code:
New code (deprecated):
or New code (recommended):
Use handleMUCMessage( MUCRoom*, Message&, bool ) instead.
Due to the newly available StanzaExtensions, some of handleMUCMessage()'s arguments are obsolete: Instead of single values, all of these are included in the new msg
parameter, which is the full Message stanza:
The functionality provided by this function really makes sense only for IQ stanzas of type get or set. As a result, there is a new function ClientBase::send( IQ&, IqHandler*, int ) that combines trackID()'s and send()'s functionality.
Old code:
New code:
Further, it is no longer necessary to explicitely add an ID to the IQ (for requests of type 'get' or 'set; 'result' and 'error' IQs need to have the IQ's ID passed they are supposed to answer). send() will take care of this.
The function gloox::DiscoHandler::handleDiscoInfoResult() has been removed. Replacement is: DiscoHandler::handleDiscoInfo() .
The function gloox::DiscoHandler::handleDiscoItemsResult() has been removed. Replacement is: DiscoHandler::handleDiscoItems() .
The function gloox::DiscoHandler::handleDiscoError( IQ*, int ) has been removed. Replacement is: DiscoHandler::handleDiscoError( const JID&, const Error*, int ) .
The default argument now is a const reference to a JID – defaulting to en empty JID – instead of a pointer to a JID object.
The class XDelayedDelivery has been removed as the XSF replaced XEP-0091 with XEP-0203. The class DelayedDelivery covers both XEPs.
Use the copy constructor instead. E.g.:
Old code:
New code:
This function has been replaced by JID::operator bool(). This has the added benefit of validity checking. E.g.:
Old code:
New code:
This function has been replaced by Tag::operator bool(). This has the added benefit of validity checking. E.g.:
Old code:
Or:
New code:
Or:
This function has been removed. Use the const version instead. To delete an attribute, use the new removeAttribute() .
This function has been removed. Use the const version instead. To delete a child element, use removeChild() .
These functions have been removed in favour of the more specialized classes Message , Presence , IQ , and Subscription .
The Message-based Inband Bytestream implementation has been removed in favour of an IQ-based one. Also, Inband Bytestreams are now handled (transparently) by SIProfileFT .
This function has been removed in favor of handleAdhocError( const JID&, const Error* ) .
This function has been removed in favor of handleFTRequestError( const IQ&, const std::string& ) .
This function has been removed in favor of handleBytestreamError( const IQ& iq, const std::string& sid ) .
This function has been removed in favor of handleBytestreamError( Bytestream* bs, const IQ& ) .
This function has been removed. Use Disco::identities() instead.
This function has been removed. Use Disco::identities() instead.
This function has been removed in favor of PrivateXMLHandler::handlePrivateXML( const Tag* ) .
This function has been removed in favor of PrivateXML::storeXML( const Tag*, PrivateXMLHandler* ) .
This function has been removed. The only recommended alternative is Client::Client( const JID&, const std::string&, int ) .
The second parameter is now a Session ID (sid). This should be used with SIProfileFT::acceptFTRequest() or SIProfileFT::declineFTRequest() .
The second parameter is now a Session ID (sid). It must be the same value as the Session ID (sid) passed to SIProfileFTHandler::handleFTRequest() . Further, the function has been renamed to acceptFT() .
The second parameter is now a Session ID (sid). It must be the same value as the Session ID (sid) passed to SIProfileFTHandler::handleFTRequest() . Further, the function has been renamed to declineFT() .