summaryrefslogtreecommitdiff
path: root/member.cxx
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-01-12 15:13:44 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-01-12 15:13:44 +0800
commit1e3acb613c9bfcc87c88aa6bfde2b21330dd7dd3 (patch)
treec58ef6d51cf4ff3a4bca9b24f7b7e94b1eb52b3a /member.cxx
parentadd4c1a7708fd2cb896f27559842a76f30930a0d (diff)
New account wrapper
Diffstat (limited to 'member.cxx')
-rw-r--r--member.cxx23
1 files changed, 22 insertions, 1 deletions
diff --git a/member.cxx b/member.cxx
index ee05be8..ab772d0 100644
--- a/member.cxx
+++ b/member.cxx
@@ -4,7 +4,28 @@
namespace QInterchange {
- static char *unCopy, *pwCopy;
+ static char *unCopy, *pwCopy, *cfCopy;
+
+ void Member::newAccount(QString const& username,
+ QString const& password, QString const& confirm)
+ {
+ auto unData = username.toLatin1().constData();
+ unCopy = (char*)malloc(strlen(unData) + 1);
+ strcpy(unCopy, unData);
+ auto pwData = password.toLatin1().constData();
+ pwCopy = (char*)malloc(strlen(pwData) + 1);
+ strcpy(pwCopy, pwData);
+ auto cfData = confirm.toLatin1().constData();
+ cfCopy = (char*)malloc(strlen(cfData) + 1);
+ strcpy(cfCopy, cfData);
+ interchange_member_newaccount(unCopy, pwCopy, cfCopy,
+ [](interchange_response* response) {
+ free(unCopy);
+ free(pwCopy);
+ free(cfCopy);
+ interchange_free_response(response);
+ }, nullptr);
+ }
void Member::logIn(QString const& username, QString const& password)
{