aboutsummaryrefslogtreecommitdiff
path: root/lib/room.h
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-07-08 19:37:23 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2019-07-08 19:42:43 +0900
commitf0c1269bf592f5ba1ccde3b667e6737fe75a335d (patch)
tree4c9e59ca6efb2dc126bc7ed111ad16e74dc9eccc /lib/room.h
parent36f63f398b8a36e0b276e78eceaf3c4123be6b13 (diff)
downloadlibquotient-f0c1269bf592f5ba1ccde3b667e6737fe75a335d.tar.gz
libquotient-f0c1269bf592f5ba1ccde3b667e6737fe75a335d.zip
Room: Set roomId and sender on pending events
Also: refactoring to streamline state events submission.
Diffstat (limited to 'lib/room.h')
-rw-r--r--lib/room.h26
1 files changed, 16 insertions, 10 deletions
diff --git a/lib/room.h b/lib/room.h
index 3abf262d..c79ca1e0 100644
--- a/lib/room.h
+++ b/lib/room.h
@@ -18,6 +18,7 @@
#pragma once
+#include "connection.h"
#include "csapi/message_pagination.h"
#include "events/roommessageevent.h"
#include "events/accountdataevents.h"
@@ -36,7 +37,6 @@ namespace QMatrixClient
class Avatar;
class SyncRoomData;
class RoomMemberEvent;
- class Connection;
class User;
class MemberSorter;
class LeaveRoomJob;
@@ -406,17 +406,14 @@ namespace QMatrixClient
MemberSorter memberSorter() const;
- Q_INVOKABLE void inviteCall(const QString& callId,
- const int lifetime, const QString& sdp);
- Q_INVOKABLE void sendCallCandidates(const QString& callId,
- const QJsonArray& candidates);
- Q_INVOKABLE void answerCall(const QString& callId, const int lifetime,
- const QString& sdp);
- Q_INVOKABLE void answerCall(const QString& callId,
- const QString& sdp);
- Q_INVOKABLE void hangupCall(const QString& callId);
Q_INVOKABLE bool supportsCalls() const;
+ template <typename EvT, typename... ArgTs>
+ auto setState(ArgTs&&... args) const
+ {
+ return setState(EvT(std::forward<ArgTs>(args)...));
+ }
+
public slots:
/** Check whether the room should be upgraded */
void checkVersion();
@@ -481,6 +478,15 @@ namespace QMatrixClient
/// Switch the room's version (aka upgrade)
void switchVersion(QString newVersion);
+ void inviteCall(const QString& callId,
+ const int lifetime, const QString& sdp);
+ void sendCallCandidates(const QString& callId,
+ const QJsonArray& candidates);
+ void answerCall(const QString& callId, const int lifetime,
+ const QString& sdp);
+ void answerCall(const QString& callId, const QString& sdp);
+ void hangupCall(const QString& callId);
+
signals:
/// Initial set of state events has been loaded
/**