From 459f11326feb68947905e267960b736ba0dff8a2 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 16 Nov 2020 15:21:46 +0100 Subject: Matrix: fix crash when failing to send message or read marker --- src/plugins/Matrix.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/plugins') 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; } -- cgit v1.2.3