summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--interchange/member.hxx4
-rw-r--r--member.cxx12
2 files changed, 15 insertions, 1 deletions
diff --git a/interchange/member.hxx b/interchange/member.hxx
index 31b9cc6..4031f7e 100644
--- a/interchange/member.hxx
+++ b/interchange/member.hxx
@@ -85,7 +85,7 @@ namespace QInterchange {
void logIn(QString const& username,
QString const& password,
QString const& failPage = nullptr);
-
+ void account();
void setAccount(QString const& firstName,
QString const& lastName,
QString const& address1,
@@ -102,6 +102,7 @@ namespace QInterchange {
signals:
void created(QString const& response);
void loggedIn(QString const& response);
+ void gotAccount(QString const& response);
void userNameChanged();
void userNickChanged();
void passwordChanged();
@@ -125,6 +126,7 @@ namespace QInterchange {
protected:
void emitCreation(QString const& response);
void emitLogin(QString const& response);
+ void emitAccount(QString const& response);
private:
QString m_userName;
diff --git a/member.cxx b/member.cxx
index fd6167e..aa0c66d 100644
--- a/member.cxx
+++ b/member.cxx
@@ -334,6 +334,14 @@ namespace QInterchange {
if (m_data != data) m_data = data;
}
+ void Member::account()
+ {
+ interchange_member_account([](interchange_response* response) {
+ member->emitAccount(QString{response->data});
+ interchange_free_response(response);
+ });
+ }
+
void Member::setAccount(QString const& firstName,
QString const& lastName, QString const& address1,
QString const& address2, QString const& city,
@@ -375,4 +383,8 @@ namespace QInterchange {
emit loggedIn(response);
}
+ void Member::emitAccount(QString const& response)
+ {
+ emit gotAccount(response);
+ }
}