From 7f2ed0ff4588043500b739e151c4db73e5e2968e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 22 Dec 2023 17:27:26 +0300 Subject: ICQ: fix for occasional crash --- protocols/ICQ-WIM/src/server.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp index b160cea08a..16472244f3 100644 --- a/protocols/ICQ-WIM/src/server.cpp +++ b/protocols/ICQ-WIM/src/server.cpp @@ -320,7 +320,8 @@ void CIcqProto::OnLoggedIn() for (auto &it : m_arCache) it->m_timer1 = it->m_timer2 = 0; - setWord(m_hFavContact, "Status", ID_STATUS_ONLINE); + if (m_hFavContact != INVALID_CONTACT_ID) + setWord(m_hFavContact, "Status", ID_STATUS_ONLINE); SetServerStatus(m_iDesiredStatus); RetrieveUserInfo(0); @@ -1287,7 +1288,9 @@ void CIcqProto::OnStartSession(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *) m_fetchBaseURL = data["fetchBaseURL"].as_mstring(); m_aimsid = data["aimsid"].as_mstring(); - ProcessMyInfo(data["myInfo"]); + auto &myInfo = data["myInfo"]; + ProcessMyInfo(myInfo); + SetOwnId(myInfo["aimId"].as_mstring()); int srvTS = data["ts"].as_int(); m_iTimeShift = (srvTS) ? time(0) - srvTS : 0; -- cgit v1.2.3