Return whether event already existed from event_handler.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -208,6 +208,7 @@ async fn create_join_event(
|
||||
.handle_incoming_pdu(&origin, room_id, &event_id, value.clone(), true)
|
||||
.boxed()
|
||||
.await?
|
||||
.map(at!(0))
|
||||
.ok_or_else(|| err!(Request(InvalidParam("Could not accept as timeline event."))))?;
|
||||
|
||||
drop(mutex_lock);
|
||||
|
||||
@@ -11,7 +11,7 @@ use ruma::{
|
||||
serde::JsonObject,
|
||||
};
|
||||
use tuwunel_core::{
|
||||
Err, Result, err,
|
||||
Err, Result, at, err,
|
||||
matrix::{event::gen_event_id_canonical_json, pdu::PduEvent},
|
||||
warn,
|
||||
};
|
||||
@@ -170,6 +170,7 @@ pub(crate) async fn create_knock_event_v1_route(
|
||||
.handle_incoming_pdu(&origin, &body.room_id, &event_id, value.clone(), true)
|
||||
.boxed()
|
||||
.await?
|
||||
.map(at!(0))
|
||||
.ok_or_else(|| err!(Request(InvalidParam("Could not accept as timeline event."))))?;
|
||||
|
||||
drop(mutex_lock);
|
||||
|
||||
@@ -11,7 +11,7 @@ use ruma::{
|
||||
},
|
||||
};
|
||||
use serde_json::value::RawValue as RawJsonValue;
|
||||
use tuwunel_core::{Err, Result, err, matrix::event::gen_event_id_canonical_json};
|
||||
use tuwunel_core::{Err, Result, at, err, matrix::event::gen_event_id_canonical_json};
|
||||
use tuwunel_service::Services;
|
||||
|
||||
use crate::Ruma;
|
||||
@@ -151,6 +151,7 @@ async fn create_leave_event(
|
||||
.handle_incoming_pdu(origin, room_id, &event_id, value, true)
|
||||
.boxed()
|
||||
.await?
|
||||
.map(at!(0))
|
||||
.ok_or_else(|| err!(Request(InvalidParam("Could not accept as timeline event."))))?;
|
||||
|
||||
drop(mutex_lock);
|
||||
|
||||
Reference in New Issue
Block a user