diff --git a/include/Cache.h b/include/Cache.h
index 76266ebd..b4dcdb90 100644
--- a/include/Cache.h
+++ b/include/Cache.h
@@ -286,6 +286,9 @@ public:
bool isFormatValid();
void setCurrentFormat();
+ //! Retrieve all the user ids from a room.
+ std::vector<std::string> roomMembers(const std::string &room_id);
+
//! Check if the given user has power leve greater than than
//! lowest power level of the given events.
bool hasEnoughPowerLevel(const std::vector<mtx::events::EventType> &eventTypes,
@@ -358,8 +361,9 @@ public:
void saveOutboundMegolmSession(const std::string &room_id,
const OutboundGroupSessionData &data,
mtx::crypto::OutboundGroupSessionPtr session);
- OutboundGroupSessionDataRef getOutboundMegolmSession(const MegolmSessionIndex &index);
- bool outboundMegolmSessionExists(const MegolmSessionIndex &index) noexcept;
+ OutboundGroupSessionDataRef getOutboundMegolmSession(const std::string &room_id);
+ bool outboundMegolmSessionExists(const std::string &room_id) noexcept;
+ void updateOutboundMegolmSession(const std::string &room_id, int message_index);
//
// Inbound Megolm Sessions
diff --git a/include/Olm.hpp b/include/Olm.hpp
index 2f7b1d64..0839f01c 100644
--- a/include/Olm.hpp
+++ b/include/Olm.hpp
@@ -1,6 +1,7 @@
#pragma once
#include <memory>
+#include <mtx.hpp>
#include <mtxclient/crypto/client.hpp>
constexpr auto OLM_ALGO = "m.olm.v1.curve25519-aes-sha2";
@@ -62,4 +63,10 @@ void
handle_pre_key_olm_message(const std::string &sender,
const std::string &sender_key,
const OlmCipherContent &content);
+
+mtx::events::msg::Encrypted
+encrypt_group_message(const std::string &room_id,
+ const std::string &device_id,
+ const std::string &body);
+
} // namespace olm
diff --git a/include/timeline/TimelineView.h b/include/timeline/TimelineView.h
index 2c369d5f..5b5c2292 100644
--- a/include/timeline/TimelineView.h
+++ b/include/timeline/TimelineView.h
@@ -185,6 +185,7 @@ private:
void sendRoomMessageHandler(const std::string &txn_id,
const mtx::responses::EventId &res,
mtx::http::RequestErr err);
+ void prepareEncryptedMessage(const PendingMessage &msg);
//! Call the /messages endpoint to fill the timeline.
void getMessages();
|