revamp appservice registration to ruma's Registration type

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

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
Matthias Ahouansou 2024-02-07 17:48:01 -05:00 committed by June
parent 0e9eb22ee7
commit 784d307425
13 changed files with 203 additions and 208 deletions

View file

@ -10,7 +10,7 @@ use std::fmt::Write;
use clap::{Parser, Subcommand};
use regex::Regex;
use ruma::{
api::client::error::ErrorKind,
api::{appservice::Registration, client::error::ErrorKind},
events::{
relation::InReplyTo,
room::{
@ -472,7 +472,7 @@ impl Service {
{
let appservice_config = body[1..body.len() - 1].join("\n");
let parsed_config =
serde_yaml::from_str::<serde_yaml::Value>(&appservice_config);
serde_yaml::from_str::<Registration>(&appservice_config);
match parsed_config {
Ok(yaml) => match services().appservice.register_appservice(yaml) {
Ok(id) => RoomMessageEventContent::text_plain(format!(