aboutsummaryrefslogtreecommitdiff
path: root/lib/events/callhangupevent.h
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-10-04 14:41:48 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-10-04 14:49:04 +0900
commit50cc85d3dea93735fe352831421eea2fcf9c24c5 (patch)
tree7aa91a3da084058a8fdd87ca9f72ed313eac79ec /lib/events/callhangupevent.h
parent5f2b4caa9b9cd63e1652d6550ceebecdb52df424 (diff)
downloadlibquotient-50cc85d3dea93735fe352831421eea2fcf9c24c5.tar.gz
libquotient-50cc85d3dea93735fe352831421eea2fcf9c24c5.zip
Modernise and fix code dealing with call events
Call events no more store deserialised values; instead they deserialise values on the fly, same as all other events. They are no more treated as state events (The Spec doesn't define them as state events in the first place). A common base class, CallEventBase, is introduced that defines data pieces common to all call events (call id and version).
Diffstat (limited to 'lib/events/callhangupevent.h')
-rw-r--r--lib/events/callhangupevent.h20
1 files changed, 1 insertions, 19 deletions
diff --git a/lib/events/callhangupevent.h b/lib/events/callhangupevent.h
index 57e565a6..c74e20d5 100644
--- a/lib/events/callhangupevent.h
+++ b/lib/events/callhangupevent.h
@@ -22,31 +22,13 @@
namespace QMatrixClient
{
- class CallHangupEvent: public RoomEvent
+ class CallHangupEvent: public CallEventBase
{
public:
DEFINE_EVENT_TYPEID("m.call.hangup", CallHangupEvent)
explicit CallHangupEvent(const QJsonObject& obj);
-
explicit CallHangupEvent(const QString& callId);
-
- bool isStateEvent() const override { return true; }
-
- const QString& callId() const { return _callId; }
- const int version() const { return _version; }
-
- QJsonObject toJson() const
- {
- QJsonObject obj;
- obj.insert("call_id", _callId);
- obj.insert("version", _version);
- return obj;
- }
-
- private:
- QString _callId;
- int _version;
};
REGISTER_EVENT_TYPE(CallHangupEvent)