fixes around group events

This commit is contained in:
Dan Ballard 2023-10-21 10:00:17 -07:00
parent 94a9a3448e
commit 98571f5559
1 changed files with 1 additions and 13 deletions

View File

@ -489,8 +489,6 @@ pub enum Event {
content_hash: String,
/// path to picture for sender
picture: String,
/// name of sender
nick: String,
/// notification policy (based on settings)
notification: MessageNotification,
},
@ -517,18 +515,12 @@ pub enum Event {
profile_id: ProfileIdentity,
/// conversation id
conversation_id: ConversationID,
/// group id
group_id: GroupID,
/// server the group is on
group_server: String,
/// invite string
group_invite: String,
/// group name
group_name: String,
/// path to group picture
picture: String,
/// Access Control List for group
access_control_list: ACL,
},
/// a server connection state has changed
ServerStateChange {
@ -806,7 +798,6 @@ impl From<&CwtchEvent> for Event {
content_hash: cwtch_event.data["ContentHash"].clone(),
conversation_id: cwtch_event.data["ConversationID"].parse().unwrap_or(-2).into(),
contact_id: cwtch_event.data["RemotePeer"].clone().into(),
nick: cwtch_event.data["Nick"].clone(),
message: MessageWrapper::from_json(&cwtch_event.data["Data"]),
notification: MessageNotification::from(cwtch_event.data["notification"].clone()),
picture: cwtch_event.data["picture"].clone(),
@ -823,12 +814,9 @@ impl From<&CwtchEvent> for Event {
"NewGroup" => Event::NewGroup {
profile_id: cwtch_event.data["ProfileOnion"].clone().into(),
conversation_id: cwtch_event.data["ConversationID"].parse().unwrap_or(-2).into(),
group_id: cwtch_event.data["GroupID"].clone().into(),
group_server: cwtch_event.data["GroupServer"].clone(),
group_invite: cwtch_event.data["GroupInvite"].clone(),
group_name: cwtch_event.data["GroupName"].clone(),
picture: cwtch_event.data["picture"].clone(),
access_control_list: serde_json::from_str(cwtch_event.data["accessControlList"].as_str()).unwrap_or(ACL::new()),
group_invite: cwtch_event.data["GroupInvite"].clone(),
},
"ServerStateChange" => Event::ServerStateChange {
profile_id: cwtch_event.data["ProfileOnion"].clone().into(),