aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2010-08-23 07:23:40 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2010-08-23 07:23:40 +0000
commite67dde48ea79197906c76247c023bb5e646eb2eb (patch)
tree74d8d0035dc9524447c483bc4f2e0f2b026a4e7e /src
parent6730deccb71d9fdb98c8b69fd71926d4390b9f11 (diff)
downloadqxmpp-e67dde48ea79197906c76247c023bb5e646eb2eb.tar.gz
add code documentation for incoming client stream
Diffstat (limited to 'src')
-rw-r--r--src/QXmppIncomingClient.cpp24
-rw-r--r--src/QXmppIncomingClient.h4
2 files changed, 25 insertions, 3 deletions
diff --git a/src/QXmppIncomingClient.cpp b/src/QXmppIncomingClient.cpp
index 0e51958c..dcfe26f0 100644
--- a/src/QXmppIncomingClient.cpp
+++ b/src/QXmppIncomingClient.cpp
@@ -47,6 +47,13 @@ public:
QByteArray saslNonce;
};
+/// Constructs a new incoming client stream.
+///
+/// \param socket The socket for the XMPP stream.
+/// \param domain The local domain.
+/// \param parent The parent QObject for the stream (optional).
+///
+
QXmppIncomingClient::QXmppIncomingClient(QSslSocket *socket, const QString &domain, QObject *parent)
: QXmppStream(parent),
d(new QXmppIncomingClientPrivate)
@@ -66,16 +73,25 @@ QXmppIncomingClient::QXmppIncomingClient(QSslSocket *socket, const QString &doma
Q_ASSERT(check);
}
+/// Destroys the current stream.
+///
+
QXmppIncomingClient::~QXmppIncomingClient()
{
delete d;
}
+/// Returns true if the client is authenticated and a resource is bound.
+///
+
bool QXmppIncomingClient::isConnected() const
{
- return !d->username.isEmpty();
+ return !d->username.isEmpty() && !d->resource.isEmpty();
}
+/// Returns the client's JID.
+///
+
QString QXmppIncomingClient::jid() const
{
if (d->username.isEmpty())
@@ -86,6 +102,11 @@ QString QXmppIncomingClient::jid() const
return jid;
}
+/// Sets the password checker used to verify client credentials.
+///
+/// \param checker
+///
+
void QXmppIncomingClient::setPasswordChecker(QXmppPasswordChecker *checker)
{
d->passwordChecker = checker;
@@ -278,4 +299,3 @@ void QXmppIncomingClient::slotTimeout()
disconnectFromHost();
}
-
diff --git a/src/QXmppIncomingClient.h b/src/QXmppIncomingClient.h
index a09fcf5f..ca8af0e4 100644
--- a/src/QXmppIncomingClient.h
+++ b/src/QXmppIncomingClient.h
@@ -30,12 +30,14 @@ class QXmppIncomingClientPrivate;
/// Interface for password checkers.
///
-/// FIXME : make this an abstract class
class QXmppPasswordChecker
{
public:
+ /// Checks that the given credentials are valid.
virtual bool check(const QString &username, const QString &password) = 0;
+
+ /// Retrieves the password for the given username.
virtual bool get(const QString &username, QString &password) = 0;
};