#include <registration.h>
Inherits IqHandler.
Inheritance diagram for Registration:
Public Types | |
enum | fieldEnum |
Public Member Functions | |
Registration (ClientBase *parent) | |
virtual | ~Registration () |
void | fetchRegistrationFields () |
void | createAccount (int fields, fieldStruct values) |
void | removeAccount () |
void | changePassword (const std::string &password) |
void | registerRegistrationHandler (RegistrationHandler *rh) |
void | removeRegistrationHandler () |
virtual bool | handleIq (Stanza *stanza) |
virtual bool | handleIqID (Stanza *stanza, int context) |
Classes | |
struct | fieldStruct |
Derive your object from RegistrationHandler and implement the virtual functions offered by that interface. Then use it like this:
Client *c = new Client( "example.org" ); c->disableRoster(); // not needed c->disableDisco(); // not needed Registration* r = new Registration( c ); r->registerRegistrationHandler( this ); r->fetchRegistrationFields(); c->connect();
int
representing the bit-wise ORed fields you want to have included in the registration attempt. For your convenience you can use the 'fields' argument of handleRegistrationFields(). ;) It's your responsibility to make sure at least those fields the server requested are filled in.
Check tests/register_test
.cpp for an example.
Definition at line 56 of file registration.h.
|
The possible fields of a JEP-0077 account registration. Definition at line 87 of file registration.h. |
|
Constructor.
Definition at line 23 of file registration.cpp. References ClientBase::registerIqHandler(). |
|
Virtual destructor. Definition at line 30 of file registration.cpp. References ClientBase::removeIqHandler(). |
|
Tells the server to change the password for the current account.
Definition at line 125 of file registration.cpp. References Tag::addAttrib(), Tag::addChild(), ClientBase::authed(), ClientBase::getID(), ClientBase::send(), ClientBase::server(), ClientBase::trackID(), and ClientBase::username(). |
|
|
Use this function to request the registration fields the server requires. The required fields are returned asynchronously to the object registered as RegistrationHandler by calling RegistrationHandler::handleRegistrationFields(). Definition at line 36 of file registration.cpp. References Tag::addAttrib(), Tag::addChild(), ClientBase::getID(), ClientBase::send(), ClientBase::state(), gloox::STATE_CONNECTED, and ClientBase::trackID(). |
|
Reimplement this function if you want to be notified about incoming IQs.
Implements IqHandler. Definition at line 156 of file registration.cpp. References Tag::findChild(), RegistrationHandler::handleRegistrationResult(), RegistrationHandler::REGISTRATION_BAD_REQUEST, RegistrationHandler::REGISTRATION_CONFLICT, RegistrationHandler::REGISTRATION_FORBIDDEN, RegistrationHandler::REGISTRATION_NOT_ACCEPTABLE, RegistrationHandler::REGISTRATION_NOT_ALLOWED, RegistrationHandler::REGISTRATION_NOT_AUTHORIZED, RegistrationHandler::REGISTRATION_REGISTRATION_REQUIRED, RegistrationHandler::REGISTRATION_UNEXPECTED_REQUEST, gloox::STANZA_IQ_ERROR, and Stanza::subtype(). |
|
Reimplement this function if you want to be notified about incoming IQs with a specific value of the
Implements IqHandler. Definition at line 187 of file registration.cpp. References Tag::findChild(), RegistrationHandler::handleAlreadyRegistered(), RegistrationHandler::handleRegistrationFields(), RegistrationHandler::handleRegistrationResult(), Tag::hasChild(), RegistrationHandler::REGISTRATION_SUCCESS, gloox::STANZA_IQ_RESULT, and Stanza::subtype(). |
|
Registers the given
Definition at line 146 of file registration.cpp. |
|
Tells the server to remove the currently authenticated account from the server. Definition at line 105 of file registration.cpp. References Tag::addAttrib(), Tag::addChild(), ClientBase::authed(), JID::full(), ClientBase::getID(), ClientBase::jid(), ClientBase::send(), and ClientBase::trackID(). |
|
Un-registers the current RegistrationHandler. Definition at line 151 of file registration.cpp. |