Merge branch '198-support-user-password-resets' into 'next'

feat: support user password resets

Closes #198

See merge request famedly/conduit!339
This commit is contained in:
Timo Kösters 2022-04-07 12:11:55 +00:00
commit 9e29dc808f
5 changed files with 108 additions and 3 deletions

View file

@ -1496,7 +1496,11 @@ impl Rooms {
let server_user = format!("@conduit:{}", db.globals.server_name());
let to_conduit = body.starts_with(&format!("{}: ", server_user));
let from_conduit = pdu.sender == server_user;
// This will evaluate to false if the emergency password is set up so that
// the administrator can execute commands as conduit
let from_conduit =
pdu.sender == server_user && db.globals.emergency_password().is_none();
if to_conduit && !from_conduit && admin_room.as_ref() == Some(&pdu.room_id) {
db.admin.process_message(body.to_string());