fix logic arroudn accept/block contact and add unblock support #421

Merged
sarah merged 3 commits from fixAcceptBlock into master 2022-01-06 21:18:39 +00:00
Owner
No description provided.
dan added 1 commit 2022-01-06 17:56:39 +00:00
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
830e479539
fix logic arroudn accept/block contact and add unblock support
Member
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch/641
sarah requested changes 2022-01-06 18:14:49 +00:00
@ -14,2 +14,4 @@
}
// Serialize transforms the AccessControl into json.
func (ac *AccessControl) Serialize() []byte {
Owner

this shouldn't be needed. AccessControlList already has a Serialize and AcessControl should never be serialized like this by itself.

this shouldn't be needed. `AccessControlList` already has a `Serialize` and `AcessControl` should never be serialized like this by itself.
dan marked this conversation as resolved
@ -501,1 +503,4 @@
// BlockConversation looks up a conversation by `handle` and sets the Blocked ACL field to `true`
// This will cause Cwtch to never try to connect to and refuse connections from the peer
func (cp *cwtchPeer) BlockConversation(id int) error {
return cp.setACL(id, &model.AccessControl{Blocked: true, Read: false, Append: false})
Owner

block should not overwrite other flags.

block should not overwrite other flags.
dan marked this conversation as resolved
@ -502,0 +509,4 @@
// UnblockConversation looks up a conversation by `handle` and sets the Blocked ACL field to `true`
// Further actions depend on the Accepted field
func (cp *cwtchPeer) UnblockConversation(id int) error {
return cp.setACL(id, &model.AccessControl{Blocked: false, Read: false, Append: false})
Owner

unblock should not overwrite other flags.

unblock should not overwrite other flags.
dan marked this conversation as resolved
Member
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch/643
Member
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch/645
sarah reviewed 2022-01-06 21:13:41 +00:00
@ -508,1 +533,4 @@
return err
}
// p2p conversations have a single ACL referencing the remote peer. Set this to blocked...
Owner

comment is incorrect

comment is incorrect
sarah approved these changes 2022-01-06 21:14:45 +00:00
dan force-pushed fixAcceptBlock from 869187c20e to 81095f7ade 2022-01-06 21:16:23 +00:00 Compare
dan force-pushed fixAcceptBlock from 27438f0e6a to e22bda5bc7 2022-01-06 21:17:40 +00:00 Compare
sarah added 1 commit 2022-01-06 21:18:09 +00:00
continuous-integration/drone/pr Build is pending Details
continuous-integration/drone/push Build is passing Details
db8d02e842
Merge branch 'master' into fixAcceptBlock
sarah merged commit db05f7d51c into master 2022-01-06 21:18:39 +00:00
Sign in to join this conversation.
No description provided.