common: Merge ruma-events into ruma-common
This commit is contained in:
@@ -18,13 +18,12 @@ compat = []
|
||||
unstable-exhaustive-types = []
|
||||
|
||||
# Private, only used in test / benchmarking code
|
||||
__ci = ["ruma-events/unstable-pre-spec"]
|
||||
__ci = ["ruma-common/unstable-pre-spec"]
|
||||
|
||||
[dependencies]
|
||||
itertools = "0.10.0"
|
||||
js_int = "0.2.0"
|
||||
ruma-common = { version = "0.8.0", path = "../ruma-common" }
|
||||
ruma-events = { version = "0.26.0", path = "../ruma-events" }
|
||||
ruma-common = { version = "0.8.0", path = "../ruma-common", features = ["events"] }
|
||||
ruma-identifiers = { version = "0.22.0", path = "../ruma-identifiers" }
|
||||
ruma-serde = { version = "0.6.0", path = "../ruma-serde" }
|
||||
serde = { version = "1.0.118", features = ["derive"] }
|
||||
@@ -36,7 +35,7 @@ tracing = "0.1.26"
|
||||
criterion = "0.3.3"
|
||||
maplit = "1.0.2"
|
||||
rand = "0.8.3"
|
||||
ruma-events = { version = "0.26.0", path = "../ruma-events", features = ["unstable-pdu"] }
|
||||
ruma-common = { version = "0.8.0", path = "../ruma-common", features = ["unstable-pdu"] }
|
||||
tracing-subscriber = "0.3.3"
|
||||
|
||||
[[bench]]
|
||||
|
||||
@@ -21,14 +21,16 @@ use criterion::{criterion_group, criterion_main, Criterion};
|
||||
use event::StateEvent;
|
||||
use js_int::{int, uint};
|
||||
use maplit::{btreemap, hashmap, hashset};
|
||||
use ruma_common::MilliSecondsSinceUnixEpoch;
|
||||
use ruma_events::{
|
||||
pdu::{EventHash, Pdu, RoomV3Pdu},
|
||||
room::{
|
||||
join_rules::{JoinRule, RoomJoinRulesEventContent},
|
||||
member::{MembershipState, RoomMemberEventContent},
|
||||
use ruma_common::{
|
||||
events::{
|
||||
pdu::{EventHash, Pdu, RoomV3Pdu},
|
||||
room::{
|
||||
join_rules::{JoinRule, RoomJoinRulesEventContent},
|
||||
member::{MembershipState, RoomMemberEventContent},
|
||||
},
|
||||
EventType,
|
||||
},
|
||||
EventType,
|
||||
MilliSecondsSinceUnixEpoch,
|
||||
};
|
||||
use ruma_identifiers::{room_id, user_id, EventId, RoomId, RoomVersionId, UserId};
|
||||
use ruma_state_res::{self as state_res, Error, Event, Result, StateMap};
|
||||
@@ -534,8 +536,10 @@ fn BAN_STATE_SET() -> HashMap<Box<EventId>, Arc<StateEvent>> {
|
||||
}
|
||||
|
||||
mod event {
|
||||
use ruma_common::MilliSecondsSinceUnixEpoch;
|
||||
use ruma_events::{pdu::Pdu, EventType};
|
||||
use ruma_common::{
|
||||
events::{pdu::Pdu, EventType},
|
||||
MilliSecondsSinceUnixEpoch,
|
||||
};
|
||||
use ruma_identifiers::{EventId, RoomId, UserId};
|
||||
use ruma_state_res::Event;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::{borrow::Borrow, collections::BTreeSet, convert::TryFrom};
|
||||
|
||||
use js_int::{int, Int};
|
||||
use ruma_events::{
|
||||
use ruma_common::events::{
|
||||
room::{
|
||||
create::RoomCreateEventContent,
|
||||
join_rules::{JoinRule, RoomJoinRulesEventContent},
|
||||
@@ -929,7 +929,7 @@ fn verify_third_party_invite(
|
||||
mod tests {
|
||||
use std::sync::Arc;
|
||||
|
||||
use ruma_events::{
|
||||
use ruma_common::events::{
|
||||
room::{
|
||||
join_rules::{
|
||||
AllowRule, JoinRule, Restricted, RoomJoinRulesEventContent, RoomMembership,
|
||||
|
||||
@@ -7,10 +7,12 @@ use std::{
|
||||
|
||||
use itertools::Itertools;
|
||||
use js_int::{int, Int};
|
||||
use ruma_common::MilliSecondsSinceUnixEpoch;
|
||||
use ruma_events::{
|
||||
room::member::{MembershipState, RoomMemberEventContent},
|
||||
EventType,
|
||||
use ruma_common::{
|
||||
events::{
|
||||
room::member::{MembershipState, RoomMemberEventContent},
|
||||
EventType,
|
||||
},
|
||||
MilliSecondsSinceUnixEpoch,
|
||||
};
|
||||
use ruma_identifiers::{EventId, RoomVersionId, UserId};
|
||||
use serde::Deserialize;
|
||||
@@ -648,10 +650,12 @@ mod tests {
|
||||
use js_int::{int, uint};
|
||||
use maplit::{hashmap, hashset};
|
||||
use rand::seq::SliceRandom;
|
||||
use ruma_common::MilliSecondsSinceUnixEpoch;
|
||||
use ruma_events::{
|
||||
room::join_rules::{JoinRule, RoomJoinRulesEventContent},
|
||||
EventType,
|
||||
use ruma_common::{
|
||||
events::{
|
||||
room::join_rules::{JoinRule, RoomJoinRulesEventContent},
|
||||
EventType,
|
||||
},
|
||||
MilliSecondsSinceUnixEpoch,
|
||||
};
|
||||
use ruma_identifiers::{EventId, RoomVersionId};
|
||||
use serde_json::{json, value::to_raw_value as to_raw_json_value};
|
||||
|
||||
@@ -5,8 +5,7 @@ use std::{
|
||||
sync::Arc,
|
||||
};
|
||||
|
||||
use ruma_common::MilliSecondsSinceUnixEpoch;
|
||||
use ruma_events::EventType;
|
||||
use ruma_common::{events::EventType, MilliSecondsSinceUnixEpoch};
|
||||
use ruma_identifiers::{EventId, RoomId, UserId};
|
||||
use serde_json::value::RawValue as RawJsonValue;
|
||||
|
||||
|
||||
@@ -9,14 +9,16 @@ use std::{
|
||||
};
|
||||
|
||||
use js_int::{int, uint};
|
||||
use ruma_common::MilliSecondsSinceUnixEpoch;
|
||||
use ruma_events::{
|
||||
pdu::{EventHash, Pdu, RoomV3Pdu},
|
||||
room::{
|
||||
join_rules::{JoinRule, RoomJoinRulesEventContent},
|
||||
member::{MembershipState, RoomMemberEventContent},
|
||||
use ruma_common::{
|
||||
events::{
|
||||
pdu::{EventHash, Pdu, RoomV3Pdu},
|
||||
room::{
|
||||
join_rules::{JoinRule, RoomJoinRulesEventContent},
|
||||
member::{MembershipState, RoomMemberEventContent},
|
||||
},
|
||||
EventType,
|
||||
},
|
||||
EventType,
|
||||
MilliSecondsSinceUnixEpoch,
|
||||
};
|
||||
use ruma_identifiers::{event_id, room_id, user_id, EventId, RoomId, RoomVersionId, UserId};
|
||||
use serde_json::{
|
||||
@@ -543,7 +545,9 @@ pub fn INITIAL_EDGES() -> Vec<Box<EventId>> {
|
||||
}
|
||||
|
||||
pub mod event {
|
||||
use ruma_events::{exports::ruma_common::MilliSecondsSinceUnixEpoch, pdu::Pdu, EventType};
|
||||
use ruma_common::events::{
|
||||
exports::ruma_common::MilliSecondsSinceUnixEpoch, pdu::Pdu, EventType,
|
||||
};
|
||||
use ruma_identifiers::{EventId, RoomId, UserId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::value::RawValue as RawJsonValue;
|
||||
|
||||
Reference in New Issue
Block a user