forked from MirrorHub/mautrix-whatsapp
Merge pull request #582 from mautrix/vurpo/reconnect
Fix reconnect on remote logout issues
This commit is contained in:
commit
acb056c894
2 changed files with 2 additions and 2 deletions
|
@ -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 {
|
||||||
|
|
|
@ -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",
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue