adding needed structs #10

Merged
sarah merged 2 commits from structs into main 2022-04-07 22:08:58 +00:00
Owner

Adding:

  • Experiments enums
  • Settings type and save function
  • Updated contact accepted and blocked fields
  • ConnectionState::new(String)
Adding: - Experiments enums - Settings type and save function - Updated contact accepted and blocked fields - ConnectionState::new(String)
dan force-pushed structs from dbf750dfcf to 70c043461b 2022-04-05 01:10:48 +00:00 Compare
sarah reviewed 2022-04-05 20:13:20 +00:00
src/structs.rs Outdated
@ -60,14 +77,18 @@ pub struct CwtchEvent {
pub struct Contact {
Owner

this should be Conversation now

this should be Conversation now
dan marked this conversation as resolved
src/structs.rs Outdated
@ -60,14 +77,18 @@ pub struct CwtchEvent {
pub struct Contact {
/// onion address / id of the contact
pub onion: String,
Owner

s/onion/handle

s/onion/handle
Author
Owner
can't, this is for deserialization https://git.openprivacy.ca/cwtch.im/libcwtch-go/src/branch/trunk/utils/contacts.go#L5
Owner

#[serde(alias = "name")]

`#[serde(alias = "name")] `
dan marked this conversation as resolved
@ -61,2 +78,4 @@
/// onion address / id of the contact
pub onion: String,
/// unique identifier of the contact/conversation to be used in API access
pub identifier: i32,
Owner

u32?

u32?
Author
Owner

can't do to auto generated api is i32, we can try and force conversion with.try_into().unwrap() but there's an additional problem in

https://git.openprivacy.ca/cwtch.im/libcwtch-go/src/branch/trunk/lib.go#L799

where we do infact use a negative convo id

can't do to auto generated api is i32, we can try and force conversion with.try_into().unwrap() but there's an additional problem in https://git.openprivacy.ca/cwtch.im/libcwtch-go/src/branch/trunk/lib.go#L799 where we do infact use a negative convo id
src/structs.rs Outdated
@ -68,3 +87,2 @@
pub status: ConnectionState,
/// contact authorization state as set by profile
pub authorization: ContactAuthorization,
/// has the contact been manually accpted
Owner

should ideally be packaged inan authorization struct exposing isAccepted() and isBlocked()

should ideally be packaged inan authorization struct exposing isAccepted() and isBlocked()
src/structs.rs Outdated
@ -71,2 +90,4 @@
/// has the contact been manually blocked
pub blocked: bool,
/// is this contact a group? if so "onion" will be a group ID
pub is_group: bool,
Owner

FIXME: deprecate

FIXME: deprecate
dan marked this conversation as resolved
src/structs.rs Outdated
@ -109,6 +130,103 @@ pub struct Message {
pub d: String,
Owner

?

?
Author
Owner
https://git.openprivacy.ca/cwtch.im/cwtch/src/branch/master/model/overlay.go
@ -112,0 +184,4 @@
/// Enum of experiment types that can be managed in Settings
pub enum Experiments {
/// experiment enabeling in app management and running of Cwtch servers
Owner

spelling enabling

spelling enabling
dan marked this conversation as resolved
src/structs.rs Outdated
@ -112,0 +186,4 @@
pub enum Experiments {
/// experiment enabeling in app management and running of Cwtch servers
ServersExperiment,
/// experiment enabeling use of Cwtch groups
Owner

spelling enabling

spelling enabling
dan marked this conversation as resolved
src/structs.rs Outdated
@ -112,0 +188,4 @@
ServersExperiment,
/// experiment enabeling use of Cwtch groups
GroupExperiment,
/// experiment enabeling filesharing
Owner

spelling enabling

spelling enabling
dan marked this conversation as resolved
dan added 1 commit 2022-04-06 04:11:42 +00:00
sarah approved these changes 2022-04-07 22:08:54 +00:00
sarah merged commit 661f1f3f4c into main 2022-04-07 22:08:58 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cwtch.im/libcwtch-rs#10
No description provided.