abstract account-data deserializations for serde_json::from_elim
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
48a767d52c
commit
da34b43302
12 changed files with 133 additions and 210 deletions
|
@ -539,9 +539,8 @@ impl Service {
|
|||
let rules_for_user = self
|
||||
.services
|
||||
.account_data
|
||||
.get(None, userid, GlobalAccountDataEventType::PushRules.to_string().into())
|
||||
.get_global(userid, GlobalAccountDataEventType::PushRules)
|
||||
.await
|
||||
.and_then(|event| serde_json::from_str::<PushRulesEvent>(event.get()).map_err(Into::into))
|
||||
.map_or_else(
|
||||
|_| push::Ruleset::server_default(userid),
|
||||
|ev: PushRulesEvent| ev.content.global,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue