add conversation id to NewMessageFromPeer

This commit is contained in:
Sarah Jamie Lewis 2022-04-26 16:32:16 -07:00
parent 59fa09a0c9
commit 3c18214507
1 changed files with 2 additions and 0 deletions

View File

@ -12,6 +12,7 @@ pub enum Event {
},
NewMessageFromPeer {
conversation_id: i32,
handle: String,
timestamp_received: DateTime<FixedOffset>,
message: String,
@ -45,6 +46,7 @@ impl From<&CwtchEvent> for Event {
data: cwtch_event.data.clone(),
},
"NewMessageFromPeer" => Event::NewMessageFromPeer {
conversation_id: cwtch_event.data["ConversationID"].parse().unwrap_or(-2),
handle: cwtch_event.data["RemotePeer"].clone(),
timestamp_received: DateTime::parse_from_rfc3339(cwtch_event.data["TimestampReceived"].as_str()).unwrap(),
message: cwtch_event.data["Data"].clone(),