Adapt to libQuotient API changes

This commit is contained in:
Tobias Fella
2022-09-05 20:37:55 +02:00
parent 14e57e7833
commit 2318fb95d9
3 changed files with 20 additions and 4 deletions

View File

@@ -8,17 +8,25 @@
namespace Quotient namespace Quotient
{ {
#ifdef QUOTIENT_07
class JoinRulesEvent : public StateEvent
#else
class JoinRulesEvent : public StateEventBase class JoinRulesEvent : public StateEventBase
#endif
{ {
public: public:
#ifdef QUOTIENT_07
QUO_EVENT(JoinRulesEvent, "m.room.join_rules")
#else
DEFINE_EVENT_TYPEID("m.room.join_rules", JoinRulesEvent) DEFINE_EVENT_TYPEID("m.room.join_rules", JoinRulesEvent)
#endif
explicit JoinRulesEvent()
: StateEventBase(typeId(), matrixTypeId())
{
}
explicit JoinRulesEvent(const QJsonObject &obj) explicit JoinRulesEvent(const QJsonObject &obj)
#ifdef QUOTIENT_07
: StateEvent(obj)
#else
: StateEventBase(typeId(), obj) : StateEventBase(typeId(), obj)
#endif
{ {
} }

View File

@@ -6,7 +6,11 @@
using namespace Quotient; using namespace Quotient;
StickerEvent::StickerEvent(const QJsonObject &obj) StickerEvent::StickerEvent(const QJsonObject &obj)
#ifdef QUOTIENT_07
: RoomEvent(obj)
#else
: RoomEvent(typeId(), obj) : RoomEvent(typeId(), obj)
#endif
, m_imageContent(EventContent::ImageContent(obj["content"_ls].toObject())) , m_imageContent(EventContent::ImageContent(obj["content"_ls].toObject()))
{ {
} }

View File

@@ -14,7 +14,11 @@ namespace Quotient
class StickerEvent : public RoomEvent class StickerEvent : public RoomEvent
{ {
public: public:
#ifdef QUOTIENT_07
QUO_EVENT(StickerEvent, "m.sticker")
#else
DEFINE_EVENT_TYPEID("m.sticker", StickerEvent) DEFINE_EVENT_TYPEID("m.sticker", StickerEvent)
#endif
explicit StickerEvent(const QJsonObject &obj); explicit StickerEvent(const QJsonObject &obj);