Merge pull request #582 from mautrix/vurpo/reconnect

Fix reconnect on remote logout issues
This commit is contained in:
vurpo 2023-01-05 16:34:27 +02:00 committed by GitHub
commit acb056c894
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -52,7 +52,7 @@ func (user *User) GetRemoteID() string {
if user == nil || user.JID.IsEmpty() { if user == nil || user.JID.IsEmpty() {
return "" 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 { func (user *User) GetRemoteName() string {

View file

@ -543,7 +543,7 @@ func jsonResponse(w http.ResponseWriter, status int, response interface{}) {
func (prov *ProvisioningAPI) Logout(w http.ResponseWriter, r *http.Request) { func (prov *ProvisioningAPI) Logout(w http.ResponseWriter, r *http.Request) {
user := r.Context().Value("user").(*User) user := r.Context().Value("user").(*User)
if user.Session == nil { if user.Session == nil {
jsonResponse(w, http.StatusNotFound, Error{ jsonResponse(w, http.StatusOK, Error{
Error: "You're not logged in", Error: "You're not logged in",
ErrCode: "not logged in", ErrCode: "not logged in",
}) })