diff options
author | George Hazan <ghazan@miranda.im> | 2022-09-08 05:11:38 -0700 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-09-08 05:11:38 -0700 |
commit | 2a6ee285a45385949bc9b0b88f646380af952e10 (patch) | |
tree | df0bc15f59e402f4d80c17bb6833e8c56e7f3758 | |
parent | 05ddec5fc752990a572521da707420de8df7430c (diff) |
ICQ: myInfo analysis unification
-rw-r--r-- | protocols/ICQ-WIM/src/poll.cpp | 6 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/server.cpp | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/protocols/ICQ-WIM/src/poll.cpp b/protocols/ICQ-WIM/src/poll.cpp index 47cbc75890..db15c5be6f 100644 --- a/protocols/ICQ-WIM/src/poll.cpp +++ b/protocols/ICQ-WIM/src/poll.cpp @@ -268,10 +268,12 @@ void CIcqProto::ProcessImState(const JSONNode &ev) void CIcqProto::ProcessMyInfo(const JSONNode &ev) { - const JSONNode &var = ev["friendly"]; - if (var) + if (auto &var = ev["friendly"]) setWString("Nick", var.as_mstring()); + if (auto &var = ev["attachedPhoneNumber"]) + setWString(DB_KEY_PHONE, var.as_mstring()); + CheckAvatarChange(0, ev); } diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp index 43d7369a2c..c77070156d 100644 --- a/protocols/ICQ-WIM/src/server.cpp +++ b/protocols/ICQ-WIM/src/server.cpp @@ -1130,9 +1130,7 @@ void CIcqProto::OnStartSession(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *) m_fetchBaseURL = data["fetchBaseURL"].as_mstring(); m_aimsid = data["aimsid"].as_mstring(); - CMStringW wszPhone(data["attachedPhoneNumber"].as_mstring()); - if (!wszPhone.IsEmpty()) - setWString(DB_KEY_PHONE, wszPhone); + ProcessMyInfo(data["myInfo"]); int srvTS = data["ts"].as_int(); m_iTimeShift = (srvTS) ? time(0) - srvTS : 0; |