1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2024-11-02 19:38:51 +01:00

Merge branch 'next' into 'next'

Fix wrong associated type in OutgoingKind::Appservice

See merge request famedly/conduit!324
This commit is contained in:
Timo Kösters 2022-04-03 19:48:25 +00:00
commit 1ce03059a0

View file

@ -38,7 +38,7 @@ use super::abstraction::Tree;
#[derive(Clone, Debug, PartialEq, Eq, Hash)] #[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub enum OutgoingKind { pub enum OutgoingKind {
Appservice(Box<ServerName>), Appservice(String),
Push(Vec<u8>, Vec<u8>), // user and pushkey Push(Vec<u8>, Vec<u8>), // user and pushkey
Normal(Box<ServerName>), Normal(Box<ServerName>),
} }
@ -505,7 +505,7 @@ impl Sending {
let db = db.read().await; let db = db.read().await;
match &kind { match &kind {
OutgoingKind::Appservice(server) => { OutgoingKind::Appservice(id) => {
let mut pdu_jsons = Vec::new(); let mut pdu_jsons = Vec::new();
for event in &events { for event in &events {
@ -535,7 +535,7 @@ impl Sending {
let response = appservice_server::send_request( let response = appservice_server::send_request(
&db.globals, &db.globals,
db.appservice db.appservice
.get_registration(server.as_str()) .get_registration(&id)
.map_err(|e| (kind.clone(), e))? .map_err(|e| (kind.clone(), e))?
.ok_or_else(|| { .ok_or_else(|| {
( (
@ -756,9 +756,7 @@ impl Sending {
})?; })?;
( (
OutgoingKind::Appservice(ServerName::parse(server).map_err(|_| { OutgoingKind::Appservice(server),
Error::bad_database("Invalid server string in server_currenttransaction")
})?),
if value.is_empty() { if value.is_empty() {
SendingEventType::Pdu(event.to_vec()) SendingEventType::Pdu(event.to_vec())
} else { } else {