多少有点毛病(

This commit is contained in:
shenjack 2024-11-16 14:05:24 +08:00
parent 9d74853d1e
commit 4aa969adc5
Signed by: shenjack
GPG Key ID: 7B1134A979775551

View File

@ -43,6 +43,8 @@ impl Room {
// 手动 patch 一下 roomId // 手动 patch 一下 roomId
// ica issue: https://github.com/Icalingua-plus-plus/Icalingua-plus-plus/issues/793 // ica issue: https://github.com/Icalingua-plus-plus/Icalingua-plus-plus/issues/793
if parse_json.get("roomId").is_none_or(|id| id.is_null()) { if parse_json.get("roomId").is_none_or(|id| id.is_null()) {
use tracing::warn;
warn!("Room::new_from_json roomId is None, patching it to -1, raw: {:#?}", raw_json);
parse_json["roomId"] = JsonValue::Number(Number::from(-1)); parse_json["roomId"] = JsonValue::Number(Number::from(-1));
} }
let inner = match serde_json::from_value::<InnerRoom>(parse_json) { let inner = match serde_json::from_value::<InnerRoom>(parse_json) {