Browse Source

Fix reconnect on remote logout issues

Max Sandholm 2 years ago
parent
commit
ee5cf7fe11
2 changed files with 2 additions and 2 deletions
  1. 1 1
      bridgestate.go
  2. 1 1
      provisioning.go

+ 1 - 1
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 {

+ 1 - 1
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",
 		})