aboutsummaryrefslogtreecommitdiff
path: root/connection.h
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-03-09 13:13:48 +0900
committerGitHub <noreply@github.com>2017-03-09 13:13:48 +0900
commitaf8f95fa0446bf377321d9f285b0e55c08fd91da (patch)
treecdd07d0df71e2f7baa87d1be73fb4e3c3473d3eb /connection.h
parentba5ca3c88a20926f2be06872f530d9da12d5a062 (diff)
parent3524342faacd12b00fa4c3a3ebe6a68782975eac (diff)
downloadlibquotient-af8f95fa0446bf377321d9f285b0e55c08fd91da.tar.gz
libquotient-af8f95fa0446bf377321d9f285b0e55c08fd91da.zip
Merge pull request #54 from Fxrh/kitsune-call-server
Connection::callApi + Room::getPreviousMessages(limit)
Diffstat (limited to 'connection.h')
-rw-r--r--connection.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/connection.h b/connection.h
index 0e25d695..1ce3e0de 100644
--- a/connection.h
+++ b/connection.h
@@ -69,6 +69,14 @@ namespace QMatrixClient
Q_INVOKABLE QString token() const;
Q_INVOKABLE QString accessToken() const;
+ template <typename JobT, typename... JobArgTs>
+ JobT* callApi(JobArgTs... jobArgs)
+ {
+ auto job = new JobT(connectionData(), jobArgs...);
+ job->start();
+ return job;
+ }
+
signals:
void resolved();
void connected();