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