Skip to content
Snippets Groups Projects
Commit 7856acdc authored by Josh Brooks's avatar Josh Brooks
Browse files

Make Delete Request calls accessible via API and bindings

parent 5e242bb9
No related branches found
No related tags found
2 merge requests!170Release,!147Implement Delete requests functions for auth store
...@@ -684,6 +684,21 @@ func (c *Client) GetNodeRegistrationStatus() (int, int, error) { ...@@ -684,6 +684,21 @@ func (c *Client) GetNodeRegistrationStatus() (int, int, error) {
return numRegistered, len(nodes) - numStale, nil return numRegistered, len(nodes) - numStale, nil
} }
// DeleteAllRequests clears all requests from client's auth storage.
func (c *Client) DeleteAllRequests() error {
return c.GetStorage().Auth().DeleteAllRequests()
}
// DeleteSentRequests clears sent requests from client's auth storage.
func (c *Client) DeleteSentRequests() error {
return c.GetStorage().Auth().DeleteSentRequests()
}
// DeleteReceiveRequests clears receive requests from client's auth storage.
func (c *Client) DeleteReceiveRequests() error {
return c.GetStorage().Auth().DeleteReceiveRequests()
}
// DeleteContact is a function which removes a partner from Client's storage // DeleteContact is a function which removes a partner from Client's storage
func (c *Client) DeleteContact(partnerId *id.ID) error { func (c *Client) DeleteContact(partnerId *id.ID) error {
jww.DEBUG.Printf("Deleting contact with ID %s", partnerId) jww.DEBUG.Printf("Deleting contact with ID %s", partnerId)
...@@ -742,8 +757,8 @@ func (c *Client) DeleteContact(partnerId *id.ID) error { ...@@ -742,8 +757,8 @@ func (c *Client) DeleteContact(partnerId *id.ID) error {
//delete conversations //delete conversations
c.storage.Conversations().Delete(partnerId) c.storage.Conversations().Delete(partnerId)
// call delete requests to make sure nothing is lingering. // call delete requests to make sure nothing is lingering.
// this is for saftey to ensure the contact can be readded // this is for saftey to ensure the contact can be readded
// in the future // in the future
_ = c.storage.Auth().Delete(partnerId) _ = c.storage.Auth().Delete(partnerId)
......
...@@ -265,6 +265,7 @@ func (c *Client) WaitForNetwork(timeoutMS int) bool { ...@@ -265,6 +265,7 @@ func (c *Client) WaitForNetwork(timeoutMS int) bool {
func (c *Client) NetworkFollowerStatus() int { func (c *Client) NetworkFollowerStatus() int {
return int(c.api.NetworkFollowerStatus()) return int(c.api.NetworkFollowerStatus())
} }
// HasRunningProcessies checks if any background threads are running. // HasRunningProcessies checks if any background threads are running.
// returns true if none are running. This is meant to be // returns true if none are running. This is meant to be
// used when NetworkFollowerStatus() returns Stopping. // used when NetworkFollowerStatus() returns Stopping.
...@@ -449,6 +450,21 @@ func (c *Client) GetNodeRegistrationStatus() (*NodeRegistrationsStatus, error) { ...@@ -449,6 +450,21 @@ func (c *Client) GetNodeRegistrationStatus() (*NodeRegistrationsStatus, error) {
return &NodeRegistrationsStatus{registered, total}, err return &NodeRegistrationsStatus{registered, total}, err
} }
// DeleteAllRequests clears all requests from Client's auth storage.
func (c *Client) DeleteAllRequests() error {
return c.api.DeleteAllRequests()
}
// DeleteSentRequests clears sent requests from Client's auth storage.
func (c *Client) DeleteSentRequests() error {
return c.api.DeleteSentRequests()
}
// DeleteReceiveRequests clears receive requests from Client's auth storage.
func (c *Client) DeleteReceiveRequests() error {
return c.api.DeleteReceiveRequests()
}
// DeleteContact is a function which removes a contact from Client's storage // DeleteContact is a function which removes a contact from Client's storage
func (c *Client) DeleteContact(b []byte) error { func (c *Client) DeleteContact(b []byte) error {
contactObj, err := UnmarshalContact(b) contactObj, err := UnmarshalContact(b)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment