fix: use device_id when registering
TIL body.device_id != (*body).device_id, which is pretty bad, so I renamed body.device_id to body.sender_device
This commit is contained in:
parent
fccd3fdb88
commit
f0a21b6165
23 changed files with 325 additions and 307 deletions
|
@ -20,11 +20,11 @@ pub fn get_pushrules_all_route(
|
|||
db: State<'_, Database>,
|
||||
body: Ruma<get_pushrules_all::Request>,
|
||||
) -> ConduitResult<get_pushrules_all::Response> {
|
||||
let sender_id = body.sender_id.as_ref().expect("user is authenticated");
|
||||
let sender_user = body.sender_user.as_ref().expect("user is authenticated");
|
||||
|
||||
let event = db
|
||||
.account_data
|
||||
.get::<ruma::events::push_rules::PushRulesEvent>(None, &sender_id, EventType::PushRules)?
|
||||
.get::<ruma::events::push_rules::PushRulesEvent>(None, &sender_user, EventType::PushRules)?
|
||||
.ok_or(Error::BadRequest(
|
||||
ErrorKind::NotFound,
|
||||
"PushRules event not found.",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue