summaryrefslogtreecommitdiff
path: root/board.cpp
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2013-04-04 00:25:54 +0200
committerJavier S. Pedro <maemo@javispedro.com>2013-04-04 00:25:54 +0200
commit723e0e7f37636379f76008582dca459490b845f4 (patch)
treed77bcd21e6d4e8b852f2a9980e18824ca1752eb8 /board.cpp
parent5d8d6fed3fd7dd796a5a3093a7dbd46fab8d380a (diff)
downloadtapasboard-723e0e7f37636379f76008582dca459490b845f4.tar.gz
tapasboard-723e0e7f37636379f76008582dca459490b845f4.zip
add login support
Diffstat (limited to 'board.cpp')
-rw-r--r--board.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/board.cpp b/board.cpp
index 1a82a91..2cad565 100644
--- a/board.cpp
+++ b/board.cpp
@@ -7,6 +7,7 @@
#include "action.h"
#include "fetchconfigaction.h"
#include "fetchforumsaction.h"
+#include "loginaction.h"
#include "xmlrpcinterface.h"
#include "board.h"
@@ -138,7 +139,7 @@ QVariant Board::getLoginInfo(const QString &key) const
void Board::login(const QString &username, const QString &password)
{
- // TODO
+ enqueueAction(new LoginAction(username, password, this));
}
void Board::logout()
@@ -255,6 +256,14 @@ void Board::notifyLogin(const QMap<QString, QVariant> &info)
_loginInfo = info;
qDebug() << "Now logged in as" << _loginInfo["username"].toString();
emit loggedInChanged();
+ if (getConfig("last_forums_fetch_logged_in") != "1") {
+ // Forum list is probably outdated, because we fetched it while
+ // we were logged out.
+ if (_iface->isAccessible()) {
+ qDebug() << "Fetching forums because of login";
+ enqueueAction(new FetchForumsAction(this));
+ }
+ }
} else {
// Double login?
_loginInfo = info;