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

Merged
sarah merged 3 commits from fixAcceptBlock into master 5 months ago
dan commented 5 months ago
Owner
There is no content yet.
dan added 1 commit 5 months ago
830e479539 fix logic arroudn accept/block contact and add unblock support
Collaborator
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch/641
sarah requested changes 5 months ago
}
// Serialize transforms the AccessControl into json.
func (ac *AccessControl) Serialize() []byte {
sarah commented 5 months ago
Poster
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
// 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})
sarah commented 5 months ago
Poster
Owner

block should not overwrite other flags.

block should not overwrite other flags.
dan marked this conversation as resolved
// 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})
sarah commented 5 months ago
Poster
Owner

unblock should not overwrite other flags.

unblock should not overwrite other flags.
dan marked this conversation as resolved
Collaborator
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch/643
Collaborator
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch/645
sarah reviewed 5 months ago
return err
}
// p2p conversations have a single ACL referencing the remote peer. Set this to blocked...
sarah commented 5 months ago
Poster
Owner

comment is incorrect

comment is incorrect
sarah approved these changes 5 months ago
dan force-pushed fixAcceptBlock from 869187c20e to 81095f7ade 5 months ago
dan force-pushed fixAcceptBlock from 27438f0e6a to e22bda5bc7 5 months ago
sarah added 1 commit 5 months ago
db8d02e842 Merge branch 'master' into fixAcceptBlock
sarah merged commit db05f7d51c into master 5 months ago

Reviewers

sarah approved these changes 5 months ago
continuous-integration/drone/pr Build is pending
continuous-integration/drone/push Build is passing
The pull request has been merged as db05f7d51c.
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.