update ruma appservice Registration type MR

from https://gitlab.com/famedly/conduit/-/merge_requests/583

and fixed panic from blocking async call in timeline/mod.rs

Co-authored-by: strawberry <strawberry@puppygock.gay>
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
Matthias Ahouansou 2024-03-08 10:50:52 -05:00 committed by June
parent 019a82850d
commit 5ab76a1332
10 changed files with 156 additions and 62 deletions

View file

@ -567,7 +567,7 @@ impl Service {
let appservice_config = body[1..body.len() - 1].join("\n");
let parsed_config = serde_yaml::from_str::<Registration>(&appservice_config);
match parsed_config {
Ok(yaml) => match services().appservice.register_appservice(yaml) {
Ok(yaml) => match services().appservice.register_appservice(yaml).await {
Ok(id) => {
RoomMessageEventContent::text_plain(format!("Appservice registered with ID: {id}."))
},
@ -587,7 +587,7 @@ impl Service {
},
AppserviceCommand::Unregister {
appservice_identifier,
} => match services().appservice.unregister_appservice(&appservice_identifier) {
} => match services().appservice.unregister_appservice(&appservice_identifier).await {
Ok(()) => RoomMessageEventContent::text_plain("Appservice unregistered."),
Err(e) => RoomMessageEventContent::text_plain(format!("Failed to unregister appservice: {e}")),
},