[fractal] API, sync and filter: Separate endpoint connection from query build
- From: Christopher Davis <christopherdavis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [fractal] API, sync and filter: Separate endpoint connection from query build
- Date: Tue, 20 Aug 2019 20:56:32 +0000 (UTC)
commit 1142c83e9ac029414478e1865ee14475893b9b81
Author: Alejandro DomÃnguez <adomu net-c com>
Date: Sat Feb 2 18:17:48 2019 +0100
API, sync and filter: Separate endpoint connection from query build
fractal-matrix-api/src/backend/mod.rs | 10 +-
fractal-matrix-api/src/backend/room.rs | 2 +-
fractal-matrix-api/src/backend/sync.rs | 148 +++++++++++----------
fractal-matrix-api/src/client.rs | 32 +++--
fractal-matrix-api/src/meson.build | 5 +-
fractal-matrix-api/src/model/mod.rs | 2 -
fractal-matrix-api/src/model/room.rs | 2 +-
fractal-matrix-api/src/r0.rs | 2 +
fractal-matrix-api/src/{model => r0}/filter.rs | 31 +++--
fractal-matrix-api/src/r0/sync.rs | 1 +
.../src/{model/sync.rs => r0/sync/sync_events.rs} | 75 ++++++++++-
fractal-matrix-api/src/ser.rs | 9 ++
fractal-matrix-api/src/types.rs | 7 -
fractal-matrix-api/src/util.rs | 2 +-
14 files changed, 212 insertions(+), 116 deletions(-)
---
diff --git a/fractal-matrix-api/src/backend/mod.rs b/fractal-matrix-api/src/backend/mod.rs
index 39c6c80d..60c7e5ca 100644
--- a/fractal-matrix-api/src/backend/mod.rs
+++ b/fractal-matrix-api/src/backend/mod.rs
@@ -173,14 +173,8 @@ impl Backend {
}
// Sync module
- Ok(BKCommand::Sync(since, initial)) => {
- let r = sync::sync(self, since, initial);
- bkerror!(r, tx, BKResponse::SyncError);
- }
- Ok(BKCommand::SyncForced) => {
- let r = sync::force_sync(self);
- bkerror!(r, tx, BKResponse::SyncError);
- }
+ Ok(BKCommand::Sync(since, initial)) => sync::sync(self, since, initial),
+ Ok(BKCommand::SyncForced) => sync::force_sync(self),
// Room module
Ok(BKCommand::GetRoomMembers(room)) => {
diff --git a/fractal-matrix-api/src/backend/room.rs b/fractal-matrix-api/src/backend/room.rs
index 9dfefbe4..7d38167e 100644
--- a/fractal-matrix-api/src/backend/room.rs
+++ b/fractal-matrix-api/src/backend/room.rs
@@ -26,10 +26,10 @@ use crate::backend::types::Backend;
use crate::backend::types::BackendData;
use crate::backend::types::RoomType;
+use crate::r0::filter::RoomEventFilter;
use crate::types::ExtraContent;
use crate::types::Member;
use crate::types::Message;
-use crate::types::RoomEventFilter;
use crate::types::{Room, RoomMembership, RoomTag};
use serde_json::Value as JsonValue;
diff --git a/fractal-matrix-api/src/backend/sync.rs b/fractal-matrix-api/src/backend/sync.rs
index ab400bf1..a3de0d47 100644
--- a/fractal-matrix-api/src/backend/sync.rs
+++ b/fractal-matrix-api/src/backend/sync.rs
@@ -1,48 +1,53 @@
use crate::backend::types::BKResponse;
use crate::backend::types::Backend;
-use crate::error::Error;
+use crate::client::ProxySettings;
use crate::globals;
+use crate::r0::filter::EventFilter;
+use crate::r0::filter::Filter;
+use crate::r0::filter::RoomEventFilter;
+use crate::r0::filter::RoomFilter;
+use crate::r0::sync::sync_events::request as sync_events;
+use crate::r0::sync::sync_events::IncludeState;
+use crate::r0::sync::sync_events::Parameters as SyncParameters;
+use crate::r0::sync::sync_events::Response as SyncResponse;
+use crate::r0::sync::sync_events::UnreadNotificationsCount;
use crate::types::Event;
-use crate::types::EventFilter;
-use crate::types::Filter;
use crate::types::Member;
use crate::types::Message;
use crate::types::Room;
-use crate::types::RoomEventFilter;
-use crate::types::RoomFilter;
use crate::types::RoomMembership;
use crate::types::RoomTag;
-use crate::types::SyncResponse;
-use crate::types::UnreadNotificationsCount;
-use crate::util::json_q;
use crate::util::parse_m_direct;
use log::error;
-use serde_json::json;
+use reqwest::Client;
use serde_json::value::from_value;
-use serde_json::Value as JsonValue;
-use std::{thread, time};
+use std::{
+ thread,
+ time::{self, Duration},
+};
-pub fn sync(bk: &Backend, new_since: Option<String>, initial: bool) -> Result<(), Error> {
- let tk = bk.data.lock().unwrap().access_token.clone();
- if tk.is_empty() {
- return Err(Error::BackendError);
- }
-
- let since = bk.data.lock().unwrap().since.clone().or(new_since);
+pub fn sync(bk: &Backend, new_since: Option<String>, initial: bool) {
+ let tx = bk.tx.clone();
+ let data = bk.data.clone();
let userid = bk.data.lock().unwrap().user_id.clone();
- let mut params = vec![("full_state", String::from("false"))];
-
- if let Some(since) = since.clone() {
- params.push(("since", since));
- }
-
- if initial {
+ let since = bk
+ .data
+ .lock()
+ .unwrap()
+ .since
+ .clone()
+ .filter(|s| !s.is_empty())
+ .or(new_since);
+
+ let (timeout, filter) = if !initial {
+ (time::Duration::from_secs(30), Default::default())
+ } else {
let filter = Filter {
room: Some(RoomFilter {
state: Some(RoomEventFilter {
- lazy_load_members: Some(true),
+ lazy_load_members: true,
types: Some(vec!["m.room.*"]),
..Default::default()
}),
@@ -71,33 +76,42 @@ pub fn sync(bk: &Backend, new_since: Option<String>, initial: bool) -> Result<()
]),
..Default::default()
};
- let filter_str =
- serde_json::to_string(&filter).expect("Failed to serialize sync request filter");
- params.push(("filter", filter_str));
- };
-
- let timeout = time::Duration::from_secs(30);
- params.push(("timeout", timeout.as_millis().to_string()));
- let baseu = bk.get_base_url();
- let url = bk.url("sync", params)?;
-
- let tx = bk.tx.clone();
- let data = bk.data.clone();
+ (Default::default(), filter)
+ };
- let attrs = json!(null);
+ let base = bk.get_base_url();
+ let params = SyncParameters {
+ access_token: data.lock().unwrap().access_token.clone(),
+ filter,
+ since: since.clone(),
+ include_state: IncludeState::Changed(timeout),
+ ..Default::default()
+ };
- get!(
- &url,
- &attrs,
- |r: JsonValue| {
- if let Ok(response) = serde_json::from_value::<SyncResponse>(r) {
+ thread::spawn(move || {
+ let client_builder_timeout =
+ Client::builder().timeout(Some(Duration::from_secs(globals::TIMEOUT) + timeout));
+
+ let query = ProxySettings::current().and_then(|proxy_settings| {
+ let client = proxy_settings
+ .apply_to_client_builder(client_builder_timeout)?
+ .build()?;
+ let request = sync_events(base.clone(), ¶ms)?;
+ client
+ .execute(request)?
+ .json::<SyncResponse>()
+ .map_err(Into::into)
+ });
+
+ match query {
+ Ok(response) => {
if since.is_some() {
let join = &response.rooms.join;
// New rooms
- let rs = Room::from_sync_response(&response, &userid, &baseu);
- tx.send(BKResponse::UpdateRooms(rs)).unwrap();
+ let rs = Room::from_sync_response(&response, &userid, &base);
+ let _ = tx.send(BKResponse::UpdateRooms(rs));
// Message events
let msgs = join
@@ -107,7 +121,7 @@ pub fn sync(bk: &Backend, new_since: Option<String>, initial: bool) -> Result<()
Message::from_json_events_iter(&k, events).into_iter()
})
.collect();
- tx.send(BKResponse::RoomMessages(msgs)).unwrap();
+ let _ = tx.send(BKResponse::RoomMessages(msgs));
// Room notifications
for (k, room) in join.iter() {
@@ -115,8 +129,7 @@ pub fn sync(bk: &Backend, new_since: Option<String>, initial: bool) -> Result<()
highlight_count: h,
notification_count: n,
} = room.unread_notifications;
- tx.send(BKResponse::RoomNotifications(k.clone(), n, h))
- .unwrap();
+ let _ = tx.send(BKResponse::RoomNotifications(k.clone(), n, h));
}
// Typing notifications
@@ -178,21 +191,20 @@ pub fn sync(bk: &Backend, new_since: Option<String>, initial: bool) -> Result<()
.as_str()
.map(Into::into)
.unwrap_or_default();
- tx.send(BKResponse::RoomName(ev.room.clone(), name))
- .unwrap();
+ let _ = tx.send(BKResponse::RoomName(ev.room.clone(), name));
}
"m.room.topic" => {
let t = ev.content["topic"]
.as_str()
.map(Into::into)
.unwrap_or_default();
- tx.send(BKResponse::RoomTopic(ev.room.clone(), t)).unwrap();
+ let _ = tx.send(BKResponse::RoomTopic(ev.room.clone(), t));
}
"m.room.avatar" => {
- tx.send(BKResponse::NewRoomAvatar(ev.room.clone())).unwrap();
+ let _ = tx.send(BKResponse::NewRoomAvatar(ev.room.clone()));
}
"m.room.member" => {
- tx.send(BKResponse::RoomMemberEvent(ev)).unwrap();
+ let _ = tx.send(BKResponse::RoomMemberEvent(ev));
}
"m.sticker" => {
// This event is managed in the room list
@@ -205,36 +217,32 @@ pub fn sync(bk: &Backend, new_since: Option<String>, initial: bool) -> Result<()
} else {
data.lock().unwrap().m_direct = parse_m_direct(&response.account_data.events);
- let rooms = Room::from_sync_response(&response, &userid, &baseu);
+ let rooms = Room::from_sync_response(&response, &userid, &base);
let jtr = data.lock().unwrap().join_to_room.clone();
let def = if !jtr.is_empty() {
rooms.iter().find(|x| x.id == jtr).cloned()
} else {
None
};
- tx.send(BKResponse::Rooms(rooms, def)).unwrap();
+ let _ = tx.send(BKResponse::Rooms(rooms, def));
}
let next_batch = response.next_batch;
- tx.send(BKResponse::Sync(next_batch.clone())).unwrap();
- data.lock().unwrap().since = Some(next_batch).filter(|s| !s.is_empty());
- } else {
- tx.send(BKResponse::SyncError(Error::BackendError)).unwrap();
+ data.lock().unwrap().since = Some(next_batch.clone()).filter(|s| !s.is_empty());
+ let _ = tx.send(BKResponse::Sync(next_batch));
}
- },
- |err| {
- // we wait if there's an error to avoid 100% CPU
- error!("Sync Error, waiting 10 seconds to respond for the next sync");
- thread::sleep(time::Duration::from_secs(10));
+ Err(err) => {
+ // we wait if there's an error to avoid 100% CPU
+ error!("Sync Error, waiting 10 seconds to respond for the next sync");
+ thread::sleep(time::Duration::from_secs(10));
- tx.send(BKResponse::SyncError(err)).unwrap();
+ tx.send(BKResponse::SyncError(err)).unwrap();
+ }
}
- );
-
- Ok(())
+ });
}
-pub fn force_sync(bk: &Backend) -> Result<(), Error> {
+pub fn force_sync(bk: &Backend) {
bk.data.lock().unwrap().since = None;
sync(bk, None, true)
}
diff --git a/fractal-matrix-api/src/client.rs b/fractal-matrix-api/src/client.rs
index 24c6fc20..bf1b4714 100644
--- a/fractal-matrix-api/src/client.rs
+++ b/fractal-matrix-api/src/client.rs
@@ -12,7 +12,7 @@ use std::time::Duration;
const PROXY_DIRECT_URI: &str = "direct://";
#[derive(Debug, Eq, PartialEq)]
-struct ProxySettings {
+pub struct ProxySettings {
http_proxy: Vec<String>,
https_proxy: Vec<String>,
}
@@ -32,7 +32,22 @@ impl ProxySettings {
)
}
- fn apply_to_client_builder(
+ pub fn current() -> Result<ProxySettings, Error> {
+ Ok(Self::new(
+ PROXY_RESOLVER
+ .with(|resolver| resolver.lookup("http://", gio::NONE_CANCELLABLE))?
+ .iter()
+ .map(ToString::to_string)
+ .collect(),
+ PROXY_RESOLVER
+ .with(|resolver| resolver.lookup("https://", gio::NONE_CANCELLABLE))?
+ .iter()
+ .map(ToString::to_string)
+ .collect(),
+ ))
+ }
+
+ pub fn apply_to_client_builder(
&self,
mut builder: reqwest::ClientBuilder,
) -> Result<reqwest::ClientBuilder, reqwest::Error> {
@@ -82,18 +97,7 @@ impl Client {
// Lock first so we don't overwrite proxy settings with outdated information
let mut inner = self.inner.lock().unwrap();
- let http_proxy = PROXY_RESOLVER
- .with(|resolver| resolver.lookup("http://", gio::NONE_CANCELLABLE))?
- .iter()
- .map(ToString::to_string)
- .collect();
- let https_proxy = PROXY_RESOLVER
- .with(|resolver| resolver.lookup("https://", gio::NONE_CANCELLABLE))?
- .iter()
- .map(ToString::to_string)
- .collect();
-
- let new_proxy_settings = ProxySettings::new(http_proxy, https_proxy);
+ let new_proxy_settings = ProxySettings::current()?;
if inner.proxy_settings == new_proxy_settings {
Ok(inner.client.clone())
diff --git a/fractal-matrix-api/src/meson.build b/fractal-matrix-api/src/meson.build
index 958b39b7..fe58b6a8 100644
--- a/fractal-matrix-api/src/meson.build
+++ b/fractal-matrix-api/src/meson.build
@@ -10,18 +10,19 @@ api_sources = files(
'backend/user.rs',
'model/event.rs',
'model/fileinfo.rs',
- 'model/filter.rs',
'model/member.rs',
'model/message.rs',
'model/mod.rs',
'model/register.rs',
'model/room.rs',
'model/stickers.rs',
- 'model/sync.rs',
'model/user.rs',
'r0/directory/post_public_rooms.rs',
+ 'r0/sync/sync_events.rs',
'r0/thirdparty/get_supported_protocols.rs',
'r0/directory.rs',
+ 'r0/filter.rs',
+ 'r0/sync.rs',
'r0/thirdparty.rs',
'cache.rs',
'client.rs',
diff --git a/fractal-matrix-api/src/model/mod.rs b/fractal-matrix-api/src/model/mod.rs
index 0a005e21..66903863 100644
--- a/fractal-matrix-api/src/model/mod.rs
+++ b/fractal-matrix-api/src/model/mod.rs
@@ -1,12 +1,10 @@
pub mod event;
pub mod fileinfo;
-pub mod filter;
pub mod member;
pub mod message;
pub mod register;
pub mod room;
pub mod stickers;
-pub mod sync;
pub mod user;
use serde::{Deserialize, Serialize};
diff --git a/fractal-matrix-api/src/model/room.rs b/fractal-matrix-api/src/model/room.rs
index 6e52517f..8405a187 100644
--- a/fractal-matrix-api/src/model/room.rs
+++ b/fractal-matrix-api/src/model/room.rs
@@ -4,7 +4,7 @@ use crate::model::member::Member;
use crate::model::member::MemberList;
use crate::model::message::Message;
use crate::r0::directory::post_public_rooms::Chunk as PublicRoomsChunk;
-use crate::types::SyncResponse;
+use crate::r0::sync::sync_events::Response as SyncResponse;
use crate::util::get_user_avatar;
use crate::util::parse_m_direct;
use log::{debug, info};
diff --git a/fractal-matrix-api/src/r0.rs b/fractal-matrix-api/src/r0.rs
index d87d88df..949e16b1 100644
--- a/fractal-matrix-api/src/r0.rs
+++ b/fractal-matrix-api/src/r0.rs
@@ -1,2 +1,4 @@
pub mod directory;
+pub mod filter;
+pub mod sync;
pub mod thirdparty;
diff --git a/fractal-matrix-api/src/model/filter.rs b/fractal-matrix-api/src/r0/filter.rs
similarity index 78%
rename from fractal-matrix-api/src/model/filter.rs
rename to fractal-matrix-api/src/r0/filter.rs
index 07fb5571..f2364ff1 100644
--- a/fractal-matrix-api/src/model/filter.rs
+++ b/fractal-matrix-api/src/r0/filter.rs
@@ -1,7 +1,7 @@
-use serde::Serialize;
+use serde::{Serialize, Serializer};
use std::ops::Not;
-#[derive(Clone, Debug, Default, Serialize)]
+#[derive(Clone, Debug, Default, PartialEq, Serialize)]
pub struct Filter<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub event_fields: Option<Vec<&'a str>>,
@@ -15,7 +15,13 @@ pub struct Filter<'a> {
pub room: Option<RoomFilter<'a>>,
}
-#[derive(Clone, Debug, Serialize)]
+impl<'a> Filter<'a> {
+ pub fn is_default(&self) -> bool {
+ *self == Default::default()
+ }
+}
+
+#[derive(Clone, Debug, PartialEq, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum EventFormat {
Client,
@@ -28,7 +34,7 @@ impl Default for EventFormat {
}
}
-#[derive(Clone, Debug, Default, Serialize)]
+#[derive(Clone, Debug, Default, PartialEq, Serialize)]
pub struct EventFilter<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i32>,
@@ -42,7 +48,7 @@ pub struct EventFilter<'a> {
pub types: Option<Vec<&'a str>>,
}
-#[derive(Clone, Debug, Default, Serialize)]
+#[derive(Clone, Debug, Default, PartialEq, Serialize)]
pub struct RoomFilter<'a> {
#[serde(skip_serializing_if = "Vec::is_empty")]
pub not_rooms: Vec<&'a str>,
@@ -60,10 +66,10 @@ pub struct RoomFilter<'a> {
pub account_data: Option<RoomEventFilter<'a>>,
}
-#[derive(Clone, Debug, Default, Serialize)]
+#[derive(Clone, Debug, Default, PartialEq, Serialize)]
pub struct RoomEventFilter<'a> {
- #[serde(skip_serializing_if = "Option::is_none")]
- pub lazy_load_members: Option<bool>,
+ #[serde(skip_serializing_if = "Not::not")]
+ pub lazy_load_members: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i32>,
#[serde(skip_serializing_if = "Vec::is_empty")]
@@ -81,3 +87,12 @@ pub struct RoomEventFilter<'a> {
#[serde(skip_serializing_if = "Not::not")]
pub contains_url: bool,
}
+
+pub fn serialize_filter_as_str<S>(filter: &Filter, ser: S) -> Result<S::Ok, S::Error>
+where
+ S: Serializer,
+{
+ let filter_str = serde_json::to_string(filter).expect("Malformed filter");
+
+ ser.serialize_str(&filter_str)
+}
diff --git a/fractal-matrix-api/src/r0/sync.rs b/fractal-matrix-api/src/r0/sync.rs
new file mode 100644
index 00000000..78aeaf20
--- /dev/null
+++ b/fractal-matrix-api/src/r0/sync.rs
@@ -0,0 +1 @@
+pub mod sync_events;
diff --git a/fractal-matrix-api/src/model/sync.rs b/fractal-matrix-api/src/r0/sync/sync_events.rs
similarity index 61%
rename from fractal-matrix-api/src/model/sync.rs
rename to fractal-matrix-api/src/r0/sync/sync_events.rs
index 1b740ead..6b6dc164 100644
--- a/fractal-matrix-api/src/model/sync.rs
+++ b/fractal-matrix-api/src/r0/sync/sync_events.rs
@@ -1,9 +1,72 @@
-use serde::Deserialize;
+use crate::r0::filter::{serialize_filter_as_str, Filter};
+use crate::ser::serialize_duration_as_millis;
+use reqwest::Client;
+use reqwest::Error;
+use reqwest::Request;
+use serde::{Deserialize, Serialize};
use serde_json::Value as JsonValue;
use std::collections::HashMap;
+use std::time::Duration;
+use url::Url;
+
+#[derive(Clone, Debug, Default, Serialize)]
+pub struct Parameters<'a> {
+ pub access_token: String,
+ #[serde(serialize_with = "serialize_filter_as_str")]
+ #[serde(skip_serializing_if = "Filter::is_default")]
+ pub filter: Filter<'a>,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub since: Option<String>,
+ #[serde(flatten)]
+ pub include_state: IncludeState,
+ #[serde(skip_serializing_if = "MarkPresence::is_default")]
+ pub set_presence: MarkPresence,
+}
+
+#[derive(Clone, Copy, Debug, PartialEq, Serialize)]
+#[serde(tag = "full_state", content = "timeout")]
+pub enum IncludeState {
+ #[serde(rename = "false")]
+ #[serde(serialize_with = "serialize_duration_as_millis")]
+ Changed(Duration),
+ #[serde(rename = "true")]
+ Full,
+}
+
+impl Default for IncludeState {
+ fn default() -> Self {
+ IncludeState::Changed(Default::default())
+ }
+}
+
+impl IncludeState {
+ pub fn is_default(&self) -> bool {
+ *self == Default::default()
+ }
+}
+
+#[derive(Clone, Debug, PartialEq, Serialize)]
+#[serde(rename_all = "lowercase")]
+pub enum MarkPresence {
+ Offline,
+ Unavailable,
+ Online,
+}
+
+impl Default for MarkPresence {
+ fn default() -> Self {
+ MarkPresence::Online
+ }
+}
+
+impl MarkPresence {
+ pub fn is_default(&self) -> bool {
+ *self == Default::default()
+ }
+}
#[derive(Clone, Debug, Deserialize)]
-pub struct SyncResponse {
+pub struct Response {
pub next_batch: String,
#[serde(default)]
pub rooms: Rooms,
@@ -123,3 +186,11 @@ pub struct DeviceLists {
#[serde(default)]
pub left: Vec<String>,
}
+
+pub fn request(base: Url, params: &Parameters) -> Result<Request, Error> {
+ let url = base
+ .join("/_matrix/client/r0/sync")
+ .expect("Malformed URL in sync_events");
+
+ Client::new().get(url).query(params).build()
+}
diff --git a/fractal-matrix-api/src/ser.rs b/fractal-matrix-api/src/ser.rs
index 2029a499..0bb56e88 100644
--- a/fractal-matrix-api/src/ser.rs
+++ b/fractal-matrix-api/src/ser.rs
@@ -1,4 +1,5 @@
use serde::Serializer;
+use std::time::Duration;
use url::Host;
pub fn serialize_option_host<S>(host: &Option<Host>, ser: S) -> Result<S::Ok, S::Error>
@@ -10,3 +11,11 @@ where
None => ser.serialize_none(),
}
}
+
+// TODO: use as_millis when duration_as_u128 is stable
+pub fn serialize_duration_as_millis<S>(duration: &Duration, ser: S) -> Result<S::Ok, S::Error>
+where
+ S: Serializer,
+{
+ ser.serialize_u64(duration.as_secs() * 1000 + (duration.subsec_millis() as u64))
+}
diff --git a/fractal-matrix-api/src/types.rs b/fractal-matrix-api/src/types.rs
index 3f6d76f5..7d950f22 100644
--- a/fractal-matrix-api/src/types.rs
+++ b/fractal-matrix-api/src/types.rs
@@ -1,10 +1,6 @@
pub use crate::model::event::Event;
pub use crate::model::fileinfo::ExtraContent;
pub use crate::model::fileinfo::Info;
-pub use crate::model::filter::EventFilter;
-pub use crate::model::filter::Filter;
-pub use crate::model::filter::RoomEventFilter;
-pub use crate::model::filter::RoomFilter;
pub use crate::model::member::Member;
pub use crate::model::member::MemberList;
pub use crate::model::message::Message;
@@ -16,8 +12,5 @@ pub use crate::model::room::RoomMembership;
pub use crate::model::room::RoomTag;
pub use crate::model::stickers::Sticker;
pub use crate::model::stickers::StickerGroup;
-pub use crate::model::sync::JoinedRoom;
-pub use crate::model::sync::SyncResponse;
-pub use crate::model::sync::UnreadNotificationsCount;
pub use crate::model::user::*;
pub use crate::model::*;
diff --git a/fractal-matrix-api/src/util.rs b/fractal-matrix-api/src/util.rs
index bba8f3a3..fd3c867d 100644
--- a/fractal-matrix-api/src/util.rs
+++ b/fractal-matrix-api/src/util.rs
@@ -20,8 +20,8 @@ use std::thread;
use crate::client::Client;
use crate::error::Error;
+use crate::r0::filter::RoomEventFilter;
use crate::types::Message;
-use crate::types::RoomEventFilter;
use reqwest::header::CONTENT_LENGTH;
use reqwest::header::CONTENT_TYPE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]