add rekeys, refounding and dissolution
This commit is contained in:
@@ -43,7 +43,6 @@ impl fmt::Display for ListError {
|
||||
|
||||
impl std::error::Error for ListError {}
|
||||
|
||||
/// A membership's keys.
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct JoinMaterial {
|
||||
pub community_id: CommunityId,
|
||||
@@ -83,7 +82,6 @@ pub struct Tombstone {
|
||||
pub extra: Extra,
|
||||
}
|
||||
|
||||
/// A member's own memberships.
|
||||
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CommunityList {
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
@@ -242,7 +240,7 @@ fn pick<'a>(
|
||||
held
|
||||
}
|
||||
|
||||
fn union(into: &mut Extra, other: Extra) {
|
||||
pub(crate) fn union(into: &mut Extra, other: Extra) {
|
||||
for (key, value) in other {
|
||||
let replace = match into.get(&key) {
|
||||
Some(existing) => canonical(&value) < canonical(existing),
|
||||
@@ -255,7 +253,7 @@ fn union(into: &mut Extra, other: Extra) {
|
||||
}
|
||||
}
|
||||
|
||||
fn canonical<T: Serialize>(value: &T) -> String {
|
||||
pub(crate) fn canonical<T: Serialize>(value: &T) -> String {
|
||||
serde_json::to_string(value).unwrap_or_default()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user