commit 9390564f21242d6506eb2b113791af53d83b63a4
parent ade988a190a6b63c67b1ae7cd59818220e8485b3
Author: Marcel <mtrnord1@gmail.com>
Date: Thu, 28 May 2020 20:52:31 +0200
Pass the event id in the message wrapper to make sure that they do not get deduplicated with same content in the same room with same sender
Took 9 minutes
Diffstat:
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/app/components/room_list.rs b/src/app/components/room_list.rs
@@ -101,7 +101,6 @@ impl Component for RoomList {
false
}
Msg::SetFilter(query) => {
- info!("{}", query);
self.state.search_query = Some(query);
true
}
diff --git a/src/app/matrix/types.rs b/src/app/matrix/types.rs
@@ -4,7 +4,7 @@ use std::sync::Arc;
use futures_locks::RwLock;
use matrix_sdk::{
events::room::message::{MessageEvent, MessageEventContent, TextMessageEventContent},
- identifiers::{RoomId, UserId},
+ identifiers::{RoomId, UserId, EventId},
js_int::UInt,
Client, Room,
};
@@ -23,6 +23,7 @@ pub struct SmallRoom {
pub struct MessageWrapper {
pub(crate) sender_displayname: Option<String>,
pub(crate) room_id: Option<RoomId>,
+ pub(crate) event_id: EventId,
pub(crate) sender: UserId,
// TODO use ruma structs
pub(crate) content: String,
@@ -57,6 +58,7 @@ impl TryFrom<MessageEvent> for MessageWrapper {
Ok(MessageWrapper {
sender_displayname: None, // We cant get it without a Client and therefor cant calculate it here
room_id: event.room_id,
+ event_id: event.event_id,
sender,
content: msg_body,
})