diff --git a/auth/callback.go b/auth/callback.go index 20073dfc3eff7feb808d81b48a2b7d5f40853022..70b9c2843406205198cdb439666741b193c52518 100644 --- a/auth/callback.go +++ b/auth/callback.go @@ -369,7 +369,7 @@ func (m *Manager) handleRequest(cmixMsg format.Message, partnerID, rndNum) cbList := m.resetCallbacks.Get(c.ID) for _, cb := range cbList { - ccb := cb.(interfaces.ResetCallback) + ccb := cb.(interfaces.ResetNotificationCallback) go ccb(c) } } diff --git a/auth/manager.go b/auth/manager.go index 6be1c8bd1695af1ff5c5609ee6c58e4effea2b62..a2ba826141ccbcf3a25bbae0c1df00afbda42d79 100644 --- a/auth/manager.go +++ b/auth/manager.go @@ -102,7 +102,7 @@ func (m *Manager) RemoveSpecificConfirmCallback(id *id.ID) { } // Adds a general callback to be used on auth session renegotiations. -func (m *Manager) AddResetCallback(cb interfaces.ResetCallback) { +func (m *Manager) AddResetNotificationCallback(cb interfaces.ResetNotificationCallback) { m.resetCallbacks.AddOverride(cb) } diff --git a/bindings/authenticatedChannels.go b/bindings/authenticatedChannels.go index f52b9e7d6ddf4b0728b4499777cbd6e017632a09..af246b5408736224ec081ae7e45806b25b4a0a60 100644 --- a/bindings/authenticatedChannels.go +++ b/bindings/authenticatedChannels.go @@ -84,7 +84,7 @@ func (c *Client) ResetSession(recipientMarshaled, // RegisterAuthCallbacks registers all callbacks for authenticated channels. // This can only be called once func (c *Client) RegisterAuthCallbacks(request AuthRequestCallback, - confirm AuthConfirmCallback, reset AuthResetCallback) { + confirm AuthConfirmCallback, reset AuthResetNotificationCallback) { requestFunc := func(requestor contact.Contact) { requestorBind := &Contact{c: &requestor} @@ -103,7 +103,7 @@ func (c *Client) RegisterAuthCallbacks(request AuthRequestCallback, c.api.GetAuthRegistrar().AddGeneralConfirmCallback(confirmFunc) c.api.GetAuthRegistrar().AddGeneralRequestCallback(requestFunc) - c.api.GetAuthRegistrar().AddResetCallback(resetFunc) + c.api.GetAuthRegistrar().AddResetNotificationCallback(resetFunc) } // ConfirmAuthenticatedChannel creates an authenticated channel out of a valid diff --git a/bindings/callback.go b/bindings/callback.go index 53ed8f1e7482f09827552a56975c4f4015c5fec9..4ad87c94ae91e1dc5d688900d75d0b404f9a1765 100644 --- a/bindings/callback.go +++ b/bindings/callback.go @@ -62,7 +62,7 @@ type AuthConfirmCallback interface { // AuthRequestCallback notifies the register whenever they receive an auth // request -type AuthResetCallback interface { +type AuthResetNotificationCallback interface { Callback(requestor *Contact) } diff --git a/interfaces/auth.go b/interfaces/auth.go index 28443cf800727ad20cd9ff9586dcb5945e0a87e5..d82625c723150b433959d22c83241c909fb3781e 100644 --- a/interfaces/auth.go +++ b/interfaces/auth.go @@ -14,7 +14,7 @@ import ( type RequestCallback func(requestor contact.Contact) type ConfirmCallback func(partner contact.Contact) -type ResetCallback func(partner contact.Contact) +type ResetNotificationCallback func(partner contact.Contact) type Auth interface { // Adds a general callback to be used on auth requests. This will be preempted @@ -43,8 +43,8 @@ type Auth interface { AddSpecificConfirmCallback(id *id.ID, cb ConfirmCallback) // Removes a specific callback to be used on auth confirm. RemoveSpecificConfirmCallback(id *id.ID) - // Add a callback to receive session renegotiations - AddResetCallback(cb ResetCallback) + // Add a callback to receive session renegotiation notifications + AddResetNotificationCallback(cb ResetNotificationCallback) //Replays all pending received requests over tha callbacks ReplayRequests() }