Add unsubscribe endpoint
This commit is contained in:
@ -22,14 +22,14 @@ pub async fn handle(input: &InputEnvelope, session: Option<Session>) -> Result<V
|
||||
}
|
||||
|
||||
async fn new_event(input: Input, session: Option<Session>) -> Result<Output, Error> {
|
||||
let _account = get_account(&session)?;
|
||||
let _account = get_account_opt(&session)?;
|
||||
let mut uuids = vec![];
|
||||
// TODO check permissions
|
||||
for mut event in input.events {
|
||||
let uuid = Uuid::new_v4();
|
||||
event.id = Some(uuid);
|
||||
uuids.push(uuid);
|
||||
subscription::push(&input.room_id, event).await?;
|
||||
subscription::push_room(&input.room_id, event).await?;
|
||||
}
|
||||
Ok(Output {events: uuids})
|
||||
}
|
||||
|
Reference in New Issue
Block a user