summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-12-22 17:27:26 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-12-22 17:27:26 +0300
commit7f2ed0ff4588043500b739e151c4db73e5e2968e (patch)
tree7d8ef592d31bcf7429c792d9dde93146489cbebd
parent2cb97e09243a3c50b9b7caa94974d01c6dbe2ceb (diff)
ICQ: fix for occasional crash
-rw-r--r--protocols/ICQ-WIM/src/server.cpp7
1 files 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;