mirror of
https://gitlab.com/famedly/conduit.git
synced 2025-01-18 20:20:09 +00:00
refactor: use re-exported JsOption from ruma rather than directly adding it as a dependency
This commit is contained in:
parent
b27e9ea95c
commit
21a5fa3ef0
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -387,7 +387,6 @@ dependencies = [
|
|||||||
"http",
|
"http",
|
||||||
"hyper",
|
"hyper",
|
||||||
"image",
|
"image",
|
||||||
"js_option",
|
|
||||||
"jsonwebtoken",
|
"jsonwebtoken",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"lru-cache",
|
"lru-cache",
|
||||||
|
@ -116,9 +116,6 @@ async-trait = "0.1.68"
|
|||||||
|
|
||||||
sd-notify = { version = "0.4.1", optional = true }
|
sd-notify = { version = "0.4.1", optional = true }
|
||||||
|
|
||||||
# stupid ruma using JsOption instead of Option
|
|
||||||
js_option = "0.1"
|
|
||||||
|
|
||||||
[target.'cfg(unix)'.dependencies]
|
[target.'cfg(unix)'.dependencies]
|
||||||
nix = { version = "0.26.2", features = ["resource"] }
|
nix = { version = "0.26.2", features = ["resource"] }
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ use ruma::{
|
|||||||
StateEventType, TimelineEventType,
|
StateEventType, TimelineEventType,
|
||||||
},
|
},
|
||||||
serde::Raw,
|
serde::Raw,
|
||||||
uint, DeviceId, OwnedDeviceId, OwnedUserId, RoomId, UInt, UserId,
|
uint, DeviceId, JsOption, OwnedDeviceId, OwnedUserId, RoomId, UInt, UserId,
|
||||||
};
|
};
|
||||||
use std::{
|
use std::{
|
||||||
collections::{hash_map::Entry, BTreeMap, BTreeSet, HashMap, HashSet},
|
collections::{hash_map::Entry, BTreeMap, BTreeSet, HashMap, HashSet},
|
||||||
@ -1616,14 +1616,12 @@ pub async fn sync_events_v4_route(
|
|||||||
sync_events::v4::SlidingSyncRoom {
|
sync_events::v4::SlidingSyncRoom {
|
||||||
name: services().rooms.state_accessor.get_name(room_id)?.or(name),
|
name: services().rooms.state_accessor.get_name(room_id)?.or(name),
|
||||||
avatar: if let Some(avatar) = avatar {
|
avatar: if let Some(avatar) = avatar {
|
||||||
ruma::JsOption::Some(avatar)
|
JsOption::Some(avatar)
|
||||||
} else {
|
} else {
|
||||||
match services().rooms.state_accessor.get_avatar(room_id)? {
|
match services().rooms.state_accessor.get_avatar(room_id)? {
|
||||||
ruma::JsOption::Some(avatar) => {
|
JsOption::Some(avatar) => JsOption::from_option(avatar.url),
|
||||||
js_option::JsOption::from_option(avatar.url)
|
JsOption::Null => JsOption::Null,
|
||||||
}
|
JsOption::Undefined => JsOption::Undefined,
|
||||||
ruma::JsOption::Null => ruma::JsOption::Null,
|
|
||||||
ruma::JsOption::Undefined => ruma::JsOption::Undefined,
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
initial: Some(roomsince == &0),
|
initial: Some(roomsince == &0),
|
||||||
|
@ -5,7 +5,6 @@ use std::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
pub use data::Data;
|
pub use data::Data;
|
||||||
use js_option::JsOption;
|
|
||||||
use lru_cache::LruCache;
|
use lru_cache::LruCache;
|
||||||
use ruma::{
|
use ruma::{
|
||||||
events::{
|
events::{
|
||||||
@ -17,7 +16,7 @@ use ruma::{
|
|||||||
},
|
},
|
||||||
StateEventType,
|
StateEventType,
|
||||||
},
|
},
|
||||||
EventId, OwnedServerName, OwnedUserId, RoomId, ServerName, UserId,
|
EventId, JsOption, OwnedServerName, OwnedUserId, RoomId, ServerName, UserId,
|
||||||
};
|
};
|
||||||
use tracing::error;
|
use tracing::error;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user