From 2737dc00334ad3a56c1b311435dbe84453ee389e Mon Sep 17 00:00:00 2001 From: Alexey Andreyev Date: Sun, 14 Jul 2019 03:54:19 +0300 Subject: E2EE: introduce EncryptedEvent --- lib/room.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/room.h') diff --git a/lib/room.h b/lib/room.h index c79ca1e0..e09556b6 100644 --- a/lib/room.h +++ b/lib/room.h @@ -24,8 +24,10 @@ #include "events/accountdataevents.h" #include "eventitem.h" #include "joinstate.h" +#include "events/encryptedevent.h" #include +#include #include #include @@ -179,6 +181,10 @@ namespace QMatrixClient int memberCount() const; int timelineSize() const; bool usesEncryption() const; + const RoomEvent *decryptMessage(EncryptedEvent* encryptedEvent) const; + const QString decryptMessage(QJsonObject personalCipherObject, QByteArray senderKey) const; + const QString sessionKey(const QString &senderKey, const QString &deviceId, const QString &sessionId) const; + const QString decryptMessage(QByteArray cipher, const QString& senderKey, const QString& deviceId, const QString& sessionId) const; int joinedCount() const; int invitedCount() const; int totalMemberCount() const; -- cgit v1.2.3 From b89d5c43746ed672d98bf350db2a9e1b0878e2d0 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sat, 18 May 2019 13:52:54 +0900 Subject: Support for receiving m.reaction events * struct EventRelation; class ReactionEvent; Room::relatedEvents() * Reaction events are processed in both history and sync batches * Redacting a reaction removes it from the list of related events * QMCTest::sendReaction() --- lib/room.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/room.h') diff --git a/lib/room.h b/lib/room.h index c79ca1e0..65b9070a 100644 --- a/lib/room.h +++ b/lib/room.h @@ -121,6 +121,7 @@ namespace QMatrixClient public: using Timeline = std::deque; using PendingEvents = std::vector; + using RelatedEvents = QVector; using rev_iter_t = Timeline::const_reverse_iterator; using timeline_iter_t = Timeline::const_iterator; @@ -264,6 +265,11 @@ namespace QMatrixClient PendingEvents::iterator findPendingEvent(const QString & txnId); PendingEvents::const_iterator findPendingEvent(const QString & txnId) const; + const RelatedEvents relatedEvents(const QString& evtId, + const char* relType) const; + const RelatedEvents relatedEvents(const RoomEvent& evt, + const char* relType) const; + bool displayed() const; /// Mark the room as currently displayed to the user /** @@ -584,6 +590,7 @@ namespace QMatrixClient void tagsAboutToChange(); void tagsChanged(); + void updatedEvent(QString eventId); void replacedEvent(const RoomEvent* newEvent, const RoomEvent* oldEvent); -- cgit v1.2.3 From 1ea94b918569dd26452f285c408e605f9dc15343 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Tue, 30 Jul 2019 07:53:34 +0900 Subject: Room::postReaction() --- lib/room.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/room.h') diff --git a/lib/room.h b/lib/room.h index 65b9070a..470bb7f9 100644 --- a/lib/room.h +++ b/lib/room.h @@ -430,6 +430,8 @@ namespace QMatrixClient const QString& html, MessageEventType type = MessageEventType::Text); QString postHtmlText(const QString& plainText, const QString& html); + /// Send a reaction on a given event with a given key + QString postReaction(const QString& eventId, const QString& key); QString postFile(const QString& plainText, const QUrl& localPath, bool asGenericFile = false); /** Post a pre-created room message event -- cgit v1.2.3