aboutsummaryrefslogtreecommitdiff
path: root/lib/events
diff options
context:
space:
mode:
Diffstat (limited to 'lib/events')
-rw-r--r--lib/events/encryptedevent.h2
-rw-r--r--lib/events/event.h3
-rw-r--r--lib/events/roomevent.h41
-rw-r--r--lib/events/roommessageevent.h4
-rw-r--r--lib/events/stateevent.h2
5 files changed, 13 insertions, 39 deletions
diff --git a/lib/events/encryptedevent.h b/lib/events/encryptedevent.h
index eb7123eb..598829cd 100644
--- a/lib/events/encryptedevent.h
+++ b/lib/events/encryptedevent.h
@@ -7,7 +7,6 @@
#include "roomevent.h"
namespace Quotient {
-class Room;
/*
* While the specification states:
*
@@ -27,7 +26,6 @@ class Room;
* one and doesn't add new restrictions, just provides additional features.
*/
class EncryptedEvent : public RoomEvent {
- Q_GADGET
public:
DEFINE_EVENT_TYPEID("m.room.encrypted", EncryptedEvent)
diff --git a/lib/events/event.h b/lib/events/event.h
index 78853ced..2ed5de5d 100644
--- a/lib/events/event.h
+++ b/lib/events/event.h
@@ -195,9 +195,6 @@ inline auto registerEventType()
// === Event ===
class Event {
- Q_GADGET
- Q_PROPERTY(Type type READ type CONSTANT)
- Q_PROPERTY(QJsonObject contentJson READ contentJson CONSTANT)
public:
using Type = event_type_t;
using factory_t = EventFactory<Event>;
diff --git a/lib/events/roomevent.h b/lib/events/roomevent.h
index 3174764f..a6cd84ca 100644
--- a/lib/events/roomevent.h
+++ b/lib/events/roomevent.h
@@ -12,16 +12,6 @@ class RedactionEvent;
/** This class corresponds to m.room.* events */
class RoomEvent : public Event {
- Q_GADGET
- Q_PROPERTY(QString id READ id)
- //! \deprecated Use originTimestamp instead
- Q_PROPERTY(QDateTime timestamp READ originTimestamp CONSTANT)
- Q_PROPERTY(QDateTime originTimestamp READ originTimestamp CONSTANT)
- Q_PROPERTY(QString roomId READ roomId CONSTANT)
- Q_PROPERTY(QString senderId READ senderId CONSTANT)
- Q_PROPERTY(QString redactionReason READ redactionReason)
- Q_PROPERTY(bool isRedacted READ isRedacted)
- Q_PROPERTY(QString transactionId READ transactionId WRITE setTransactionId)
public:
using factory_t = EventFactory<RoomEvent>;
@@ -51,28 +41,23 @@ public:
QString transactionId() const;
QString stateKey() const;
+ //! \brief Fill the pending event object with the room id
void setRoomId(const QString& roomId);
+ //! \brief Fill the pending event object with the sender id
void setSender(const QString& senderId);
-
- /**
- * Sets the transaction id for locally created events. This should be
- * done before the event is exposed to any code using the respective
- * Q_PROPERTY.
- *
- * \param txnId - transaction id, normally obtained from
- * Connection::generateTxnId()
- */
+ //! \brief Fill the pending event object with the transaction id
+ //! \param txnId - transaction id, normally obtained from
+ //! Connection::generateTxnId()
void setTransactionId(const QString& txnId);
- /**
- * Sets event id for locally created events
- *
- * When a new event is created locally, it has no server id yet.
- * This function allows to add the id once the confirmation from
- * the server is received. There should be no id set previously
- * in the event. It's the responsibility of the code calling addId()
- * to notify clients that use Q_PROPERTY(id) about its change
- */
+ //! \brief Add an event id to locally created events after they are sent
+ //!
+ //! When a new event is created locally, it has no id; the homeserver
+ //! assigns it once the event is sent. This function allows to add the id
+ //! once the confirmation from the server is received. There should be no id
+ //! set previously in the event. It's the responsibility of the code calling
+ //! addId() to notify clients about the change; there's no signal or
+ //! callback for that in RoomEvent.
void addId(const QString& newId);
protected:
diff --git a/lib/events/roommessageevent.h b/lib/events/roommessageevent.h
index 88d3b74c..56597ddc 100644
--- a/lib/events/roommessageevent.h
+++ b/lib/events/roommessageevent.h
@@ -18,10 +18,6 @@ namespace MessageEventContent = EventContent; // Back-compatibility
*/
class RoomMessageEvent : public RoomEvent {
Q_GADGET
- Q_PROPERTY(QString msgType READ rawMsgtype CONSTANT)
- Q_PROPERTY(QString plainBody READ plainBody CONSTANT)
- Q_PROPERTY(QMimeType mimeType READ mimeType STORED false CONSTANT)
- Q_PROPERTY(const EventContent::TypedBase* content READ content CONSTANT)
public:
DEFINE_EVENT_TYPEID("m.room.message", RoomMessageEvent)
diff --git a/lib/events/stateevent.h b/lib/events/stateevent.h
index bc414a5f..b0aa9907 100644
--- a/lib/events/stateevent.h
+++ b/lib/events/stateevent.h
@@ -18,8 +18,6 @@ inline QJsonObject basicStateEventJson(const QString& matrixTypeId,
}
class StateEventBase : public RoomEvent {
- Q_GADGET
- Q_PROPERTY(QString stateKey READ stateKey CONSTANT)
public:
using factory_t = EventFactory<StateEventBase>;