From acf4f719a5de949f4a3d739c2b4d0bdb69bd2d9f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 13 Apr 2020 13:28:43 +0300 Subject: ICQ-WIM: sometimes ICQ cannot login after Windows return from the sleeping mode --- protocols/ICQ-WIM/src/server.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'protocols/ICQ-WIM/src/server.cpp') diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp index 70f0bfe786..a89af9c2f0 100644 --- a/protocols/ICQ-WIM/src/server.cpp +++ b/protocols/ICQ-WIM/src/server.cpp @@ -559,7 +559,7 @@ void CIcqProto::SetServerStatus(int iStatus) << AIMSID(this) << CHAR_PARAM("view", szStatus) << INT_PARAM("invisible", invisible)); if (iStatus == ID_STATUS_OFFLINE) - Push(new AsyncHttpRequest(CONN_MAIN, REQUEST_GET, ICQ_API_SERVER "/aim/endSession") << AIMSID(this)); + Push(new AsyncHttpRequest(CONN_MAIN, REQUEST_GET, ICQ_API_SERVER "/aim/endSession", &CIcqProto::OnSessionEnd) << AIMSID(this)); int iOldStatus = m_iStatus; m_iStatus = iStatus; ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)iOldStatus, m_iStatus); @@ -1062,3 +1062,15 @@ void CIcqProto::OnSendMessage(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *pReq) CheckOwnMessage(reqId, msgId, false); CheckLastId(ownMsg->m_hContact, data); } + +void CIcqProto::OnSessionEnd(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *) +{ + JsonReply root(pReply); + if (root.error() == 200) { + m_szAToken.Empty(); + delSetting(DB_KEY_ATOKEN); + + m_szSessionKey.Empty(); + delSetting(DB_KEY_SESSIONKEY); + } +} -- cgit v1.2.3