From ee5cf7fe113297d00f86ca8285eeae339bec0cbc Mon Sep 17 00:00:00 2001 From: Max Sandholm Date: Thu, 5 Jan 2023 16:28:15 +0200 Subject: [PATCH] Fix reconnect on remote logout issues --- bridgestate.go | 2 +- provisioning.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bridgestate.go b/bridgestate.go index 3062a22..7d11d7f 100644 --- a/bridgestate.go +++ b/bridgestate.go @@ -52,7 +52,7 @@ func (user *User) GetRemoteID() string { if user == nil || user.JID.IsEmpty() { return "" } - return fmt.Sprintf("%s_a%d_d%d", user.JID.User, user.JID.Agent, user.JID.Device) + return user.JID.User } func (user *User) GetRemoteName() string { diff --git a/provisioning.go b/provisioning.go index e90ba1e..07be2c6 100644 --- a/provisioning.go +++ b/provisioning.go @@ -543,7 +543,7 @@ func jsonResponse(w http.ResponseWriter, status int, response interface{}) { func (prov *ProvisioningAPI) Logout(w http.ResponseWriter, r *http.Request) { user := r.Context().Value("user").(*User) if user.Session == nil { - jsonResponse(w, http.StatusNotFound, Error{ + jsonResponse(w, http.StatusOK, Error{ Error: "You're not logged in", ErrCode: "not logged in", })