diff options
author | George Hazan <ghazan@miranda.im> | 2019-01-09 22:15:38 +0200 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-01-09 22:15:38 +0200 |
commit | aec99075210e9d107eb0f4231c0bb040ba6c1eee (patch) | |
tree | 1e5dba03094e22f70e5ca924040f7e78cdecf032 | |
parent | 492099a3f492c9282fa97ff5a595e1401d921900 (diff) |
fixes #1732 (ICQ doesn't load our own vcard on login)
-rw-r--r-- | protocols/Icq10/src/proto.h | 2 | ||||
-rw-r--r-- | protocols/Icq10/src/server.cpp | 11 |
2 files changed, 8 insertions, 5 deletions
diff --git a/protocols/Icq10/src/proto.h b/protocols/Icq10/src/proto.h index 523a8ee7c0..85feaee05a 100644 --- a/protocols/Icq10/src/proto.h +++ b/protocols/Icq10/src/proto.h @@ -81,7 +81,7 @@ class CIcqProto : public PROTO<CIcqProto> void ConnectionFailed(int iReason); void OnLoggedIn(void); void OnLoggedOut(void); - MCONTACT ParseBuddyInfo(const JSONNode &buddy); + MCONTACT ParseBuddyInfo(const JSONNode &buddy, MCONTACT hContact = -1); void ParseMessage(MCONTACT hContact, __int64 &lastMsgId, const JSONNode &msg); void RetrieveUserHistory(MCONTACT, __int64 startMsgId, __int64 endMsgId); void RetrieveUserInfo(MCONTACT); diff --git a/protocols/Icq10/src/server.cpp b/protocols/Icq10/src/server.cpp index 52daefef3f..c852883e6a 100644 --- a/protocols/Icq10/src/server.cpp +++ b/protocols/Icq10/src/server.cpp @@ -100,6 +100,7 @@ void CIcqProto::OnLoggedIn() debugLogA("CIcqProto::OnLoggedIn"); m_bOnline = true; SetServerStatus(m_iDesiredStatus); + RetrieveUserInfo(0); } void CIcqProto::OnLoggedOut() @@ -113,12 +114,14 @@ void CIcqProto::OnLoggedOut() setAllContactStatuses(ID_STATUS_OFFLINE, false); } -MCONTACT CIcqProto::ParseBuddyInfo(const JSONNode &buddy) +MCONTACT CIcqProto::ParseBuddyInfo(const JSONNode &buddy, MCONTACT hContact) { DWORD dwUin = _wtol(buddy["aimId"].as_mstring()); - MCONTACT hContact = CreateContact(dwUin, false); - FindContactByUIN(dwUin)->m_bInList = true; + if (hContact == -1) { + hContact = CreateContact(dwUin, false); + FindContactByUIN(dwUin)->m_bInList = true; + } CMStringW str(buddy["state"].as_mstring()); setDword(hContact, "Status", StatusFromString(str)); @@ -477,7 +480,7 @@ void CIcqProto::OnGetUserInfo(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *pReq) const JSONNode &data = root.data(); for (auto &it : data["users"]) - ParseBuddyInfo(it); + ParseBuddyInfo(it, hContact); ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, nullptr); } |