mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 15:51:23 +01:00
add conduit compat mode
This makes it possible to deploy Grapevine while using a database originally created by Conduit, including leaving the admin bot user's localpart the same as before.
This commit is contained in:
parent
33e7a46b53
commit
a25f2ec950
6 changed files with 104 additions and 22 deletions
|
|
@ -483,7 +483,15 @@ impl Service {
|
|||
.search
|
||||
.index_pdu(shortroomid, &pdu_id, &body)?;
|
||||
|
||||
let server_user = format!("@grapevine:{}", services().globals.server_name());
|
||||
let server_user = format!(
|
||||
"@{}:{}",
|
||||
if services().globals.config.conduit_compat {
|
||||
"conduit"
|
||||
} else {
|
||||
"grapevine"
|
||||
},
|
||||
services().globals.server_name()
|
||||
);
|
||||
|
||||
let to_grapevine = body.starts_with(&format!("{server_user}: "))
|
||||
|| body.starts_with(&format!("{server_user} "))
|
||||
|
|
@ -822,7 +830,14 @@ impl Service {
|
|||
.filter(|v| v.starts_with('@'))
|
||||
.unwrap_or(sender.as_str());
|
||||
let server_name = services().globals.server_name();
|
||||
let server_user = format!("@grapevine:{server_name}");
|
||||
let server_user = format!(
|
||||
"@{}:{server_name}",
|
||||
if services().globals.config.conduit_compat {
|
||||
"conduit"
|
||||
} else {
|
||||
"grapevine"
|
||||
},
|
||||
);
|
||||
let content = serde_json::from_str::<ExtractMembership>(pdu.content.get())
|
||||
.map_err(|_| Error::bad_database("Invalid content in pdu."))?;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue