improvement: optimize state storage
This commit is contained in:
parent
44425a903a
commit
100307c936
9 changed files with 341 additions and 254 deletions
|
@ -312,7 +312,6 @@ pub async fn send_push_notice(
|
|||
&& db
|
||||
.rooms
|
||||
.room_state_get(&pdu.room_id, &EventType::RoomPowerLevels, "")?
|
||||
.map(|(_, pl)| pl)
|
||||
.map(deserialize)
|
||||
.flatten()
|
||||
.map_or(false, power_level_cmp)
|
||||
|
@ -514,7 +513,7 @@ async fn send_notice(
|
|||
let room_name = db
|
||||
.rooms
|
||||
.room_state_get(&event.room_id, &EventType::RoomName, "")?
|
||||
.map(|(_, pdu)| match pdu.content.get("name") {
|
||||
.map(|pdu| match pdu.content.get("name") {
|
||||
Some(serde_json::Value::String(s)) => Some(s.to_string()),
|
||||
_ => None,
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue