Add unsubscribe endpoint

This commit is contained in:
2022-08-27 22:13:19 +02:00
parent 97ae71d553
commit d9672bdac0
6 changed files with 143 additions and 40 deletions

View File

@ -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})
}