aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-11-16 15:21:46 +0100
committerdec05eba <dec05eba@protonmail.com>2020-11-16 15:21:46 +0100
commit459f11326feb68947905e267960b736ba0dff8a2 (patch)
treedf54ca5c5132fd7403fadab28579c3b00cddfa51 /src/plugins
parent4e3a32ea4478e547215c6775313aaded3bc16b08 (diff)
Matrix: fix crash when failing to send message or read marker
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/Matrix.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp
index 9da6185..199cba5 100644
--- a/src/plugins/Matrix.cpp
+++ b/src/plugins/Matrix.cpp
@@ -3109,10 +3109,10 @@ namespace QuickMedia {
return download_result_to_plugin_result(download_result);
}
- PluginResult Matrix::set_read_marker(RoomData *room, const Message *message) {
+ PluginResult Matrix::set_read_marker(RoomData *room, const std::string &event_id) {
rapidjson::Document request_data(rapidjson::kObjectType);
- request_data.AddMember("m.fully_read", rapidjson::StringRef(message->event_id.c_str()), request_data.GetAllocator());
- request_data.AddMember("m.read", rapidjson::StringRef(message->event_id.c_str()), request_data.GetAllocator());
+ request_data.AddMember("m.fully_read", rapidjson::StringRef(event_id.c_str()), request_data.GetAllocator());
+ request_data.AddMember("m.read", rapidjson::StringRef(event_id.c_str()), request_data.GetAllocator());
request_data.AddMember("m.hidden", false, request_data.GetAllocator()); // What is this for? element sends it but its not part of the documentation. Is it for hiding read receipt from other users? in that case, TODO: make it configurable
rapidjson::StringBuffer buffer;
@@ -3132,7 +3132,7 @@ namespace QuickMedia {
auto me = get_me(room);
if(me)
- room->set_user_read_marker(me, message->event_id);
+ room->set_user_read_marker(me, event_id);
return PluginResult::OK;
}