Allow event ids from clients

This commit is contained in:
2022-08-27 22:33:40 +02:00
parent d9672bdac0
commit 62a7cc66bc

View File

@ -26,7 +26,10 @@ async fn new_event(input: Input, session: Option<Session>) -> Result<Output, Err
let mut uuids = vec![]; let mut uuids = vec![];
// TODO check permissions // TODO check permissions
for mut event in input.events { for mut event in input.events {
let uuid = Uuid::new_v4(); let uuid = match event.id {
Some(id) => id,
None => Uuid::new_v4(),
};
event.id = Some(uuid); event.id = Some(uuid);
uuids.push(uuid); uuids.push(uuid);
subscription::push_room(&input.room_id, event).await?; subscription::push_room(&input.room_id, event).await?;