diff --git a/api/client.go b/api/client.go index 0aee60d576cae5301f0e7d5e48f0d91e68f50a21..9272d4182d0a79c24ca8e1e97243425e81139b27 100644 --- a/api/client.go +++ b/api/client.go @@ -684,6 +684,21 @@ func (c *Client) GetNodeRegistrationStatus() (int, int, error) { 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 func (c *Client) DeleteContact(partnerId *id.ID) error { jww.DEBUG.Printf("Deleting contact with ID %s", partnerId) @@ -742,8 +757,8 @@ func (c *Client) DeleteContact(partnerId *id.ID) error { //delete conversations c.storage.Conversations().Delete(partnerId) - // call delete requests to make sure nothing is lingering. - // this is for saftey to ensure the contact can be readded + // call delete requests to make sure nothing is lingering. + // this is for saftey to ensure the contact can be readded // in the future _ = c.storage.Auth().Delete(partnerId) diff --git a/bindings/client.go b/bindings/client.go index 47e4b34a34943c09a740eaec61ef9c6f26965538..1996507cbc0a005ae20006763f6596fe1ca25834 100644 --- a/bindings/client.go +++ b/bindings/client.go @@ -265,6 +265,7 @@ func (c *Client) WaitForNetwork(timeoutMS int) bool { func (c *Client) NetworkFollowerStatus() int { return int(c.api.NetworkFollowerStatus()) } + // HasRunningProcessies checks if any background threads are running. // returns true if none are running. This is meant to be // used when NetworkFollowerStatus() returns Stopping. @@ -449,6 +450,21 @@ func (c *Client) GetNodeRegistrationStatus() (*NodeRegistrationsStatus, error) { 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 func (c *Client) DeleteContact(b []byte) error { contactObj, err := UnmarshalContact(b)