feat: state event support

This commit is contained in:
timokoesters 2020-04-06 14:33:02 +02:00
parent 10bb96fcf7
commit e55a63629c
No known key found for this signature in database
GPG key ID: 356E705610F626D5
2 changed files with 63 additions and 19 deletions

View file

@ -1,9 +1,5 @@
use crate::{utils, Database, PduEvent};
use log::debug;
use ruma_events::{
room::message::{MessageEvent, MessageEventContent},
EventType,
};
use ruma_events::EventType;
use ruma_federation_api::RoomV3Pdu;
use ruma_identifiers::{EventId, RoomId, UserId};
use std::{
@ -181,6 +177,7 @@ impl Data {
sender: UserId,
event_type: EventType,
content: serde_json::Value,
state_key: Option<String>,
) -> EventId {
// prev_events are the leaves of the current graph. This method removes all leaves from the
// room and replaces them with our event
@ -208,7 +205,7 @@ impl Data {
origin_server_ts: utils::millis_since_unix_epoch(),
kind: event_type,
content,
state_key: None,
state_key,
prev_events,
depth: depth.try_into().unwrap(),
auth_events: Vec::new(),