-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing group change types #355
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
use std::{convert::TryFrom, convert::TryInto}; | ||
|
||
use derivative::Derivative; | ||
use libsignal_protocol::ServiceId; | ||
use libsignal_protocol::{Aci, Pni, ServiceId}; | ||
use serde::{Deserialize, Serialize}; | ||
use uuid::Uuid; | ||
use zkgroup::profiles::ProfileKey; | ||
|
@@ -54,6 +54,34 @@ impl PartialEq for RequestingMember { | |
} | ||
} | ||
|
||
#[derive(Derivative, Clone)] | ||
#[derivative(Debug)] | ||
pub struct BannedMember { | ||
pub uuid: Uuid, | ||
pub timestamp: u64, | ||
} | ||
|
||
impl PartialEq for BannedMember { | ||
fn eq(&self, other: &Self) -> bool { | ||
self.uuid == other.uuid | ||
} | ||
} | ||
|
||
#[derive(Derivative, Clone)] | ||
#[derivative(Debug)] | ||
pub struct PromotedMember { | ||
pub aci: Aci, | ||
pub pni: Pni, | ||
#[derivative(Debug = "ignore")] | ||
pub profile_key: ProfileKey, | ||
} | ||
|
||
impl PartialEq for PromotedMember { | ||
fn eq(&self, other: &Self) -> bool { | ||
self.aci == other.aci && self.pni == other.pni | ||
} | ||
} | ||
|
||
#[derive(Copy, Debug, Clone, PartialEq, Serialize, Deserialize)] | ||
pub enum AccessRequired { | ||
Unknown, | ||
|
@@ -105,31 +133,31 @@ pub enum GroupChange { | |
#[derivative(Debug = "ignore")] | ||
profile_key: ProfileKey, | ||
}, | ||
// for open groups | ||
NewPendingMember(PendingMember), | ||
DeletePendingMember(Uuid), | ||
PromotePendingMember { | ||
uuid: Uuid, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are pending members E.g., for invites, IIRC it's a |
||
#[derivative(Debug = "ignore")] | ||
profile_key: ProfileKey, | ||
}, | ||
// when admin control is enabled | ||
NewRequestingMember(RequestingMember), | ||
DeleteRequestingMember(Uuid), | ||
PromoteRequestingMember { | ||
uuid: Uuid, | ||
role: Role, | ||
}, | ||
// group metadata | ||
Title(String), | ||
Avatar(String), | ||
Timer(Option<Timer>), | ||
Description(Option<String>), | ||
AttributeAccess(AccessRequired), | ||
MemberAccess(AccessRequired), | ||
InviteLinkAccess(AccessRequired), | ||
NewRequestingMember(RequestingMember), | ||
DeleteRequestingMember(Uuid), | ||
PromoteRequestingMember { | ||
uuid: Uuid, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same question |
||
role: Role, | ||
}, | ||
InviteLinkPassword(String), | ||
Description(Option<String>), | ||
AnnouncementOnly(bool), | ||
AddBannedMember(BannedMember), | ||
DeleteBannedMember(Uuid), | ||
PromotePendingPniAciMemberProfileKey(PromotedMember), | ||
} | ||
|
||
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be Aci?