diff options
-rw-r--r-- | protocols/ICQ-WIM/src/proto.h | 1 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/server.cpp | 14 |
2 files changed, 14 insertions, 1 deletions
diff --git a/protocols/ICQ-WIM/src/proto.h b/protocols/ICQ-WIM/src/proto.h index 3caad36b20..df37084f9b 100644 --- a/protocols/ICQ-WIM/src/proto.h +++ b/protocols/ICQ-WIM/src/proto.h @@ -287,6 +287,7 @@ class CIcqProto : public PROTO<CIcqProto> void OnReceiveAvatar(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *pReq); void OnSearchResults(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *pReq); void OnSendMessage(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *pReq); + void OnSessionEnd(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *pReq); void OnStartSession(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *pReq); void OnValidateSms(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *pReq); 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); + } +} |