forked from Keelrleek/SoulStream
community: spaces, an owner-signed roster with epochs, a bounded window of signed lines, bodies sealed to a rotating key when private
This commit is contained in:
1 parent
4378c4c0cc
commit
8b511b20e7
14 files changed
+2913
-13
No files matched your search
@@ -49,6 +49,29 @@ pub enum Cargo {
|
||||
FriendAssertion(fr::FriendAssertion),
|
||||
FriendDecline([u8; 16]),
|
||||
Share(ShareCargo),
|
||||
SpaceInvite(SpaceInvite),
|
||||
SpaceKey(SpaceKeyCargo),
|
||||
}
|
||||
|
||||
/// "You are on the roster now, here is where the Space is" — and, for a
|
||||
/// private Space, the epoch's key.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct SpaceInvite {
|
||||
pub space_id: [u8; 16],
|
||||
pub owner: [u8; 32],
|
||||
pub name: String,
|
||||
pub private: bool,
|
||||
pub epoch: u64,
|
||||
pub key: Option<[u8; 32]>,
|
||||
}
|
||||
|
||||
/// A rotated space key for members who stay after a removal.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct SpaceKeyCargo {
|
||||
pub space_id: [u8; 16],
|
||||
pub owner: [u8; 32],
|
||||
pub epoch: u64,
|
||||
pub key: [u8; 32],
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
@@ -410,6 +433,8 @@ async fn dispatch(app: &tauri::AppHandle, sender: [u8; 32], cargo: Cargo) {
|
||||
Cargo::FriendAssertion(a) => crate::friends::on_inbox_assertion(app, sender, a).await,
|
||||
Cargo::FriendDecline(id) => crate::friends::on_inbox_decline(app, sender, id),
|
||||
Cargo::Share(s) => crate::shared_playlists::on_inbox_share(app, sender, s),
|
||||
Cargo::SpaceInvite(i) => crate::spaces::on_inbox_invite(app, sender, i),
|
||||
Cargo::SpaceKey(k) => crate::spaces::on_inbox_space_key(app, sender, k),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user