diff options
author | George Hazan <ghazan@miranda.im> | 2018-12-30 22:03:11 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-12-30 22:03:19 +0300 |
commit | e15387a6bed3f51808ebae53220070aa4f1da86a (patch) | |
tree | 6cebb2d7d73734222f42f96ee9ef06f26c071af7 | |
parent | edd11761c0b06512b8f4a5504810908ed8337a31 (diff) |
more info extracted from presence
-rw-r--r-- | protocols/Icq10/src/server.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/protocols/Icq10/src/server.cpp b/protocols/Icq10/src/server.cpp index 05b6b6cf31..e1cf50809f 100644 --- a/protocols/Icq10/src/server.cpp +++ b/protocols/Icq10/src/server.cpp @@ -116,6 +116,35 @@ MCONTACT CIcqProto::ParseBuddyInfo(const JSONNode &buddy) str = profile["friendlyName"].as_mstring(); if (!str.IsEmpty()) setWString(hContact, "Nick", str); + + time_t birthDate = profile["birthDate"].as_int(); + if (birthDate != 0) { + struct tm *timeinfo = localtime(&birthDate); + if (timeinfo != nullptr) { + setWord(hContact, "BirthDay", timeinfo->tm_mday); + setWord(hContact, "BirthMonth", timeinfo->tm_mon+1); + setWord(hContact, "BirthYear", timeinfo->tm_year+1900); + } + } + + str = profile["gender"].as_mstring(); + if (!str.IsEmpty()) { + if (str == "male") + setByte(hContact, "Gender", 'M'); + else if (str == "female") + setByte(hContact, "Gender", 'F'); + } + + const JSONNode &homeAddress = profile["homeAddress"]; + if (homeAddress) { + str = homeAddress["city"].as_mstring(); + if (!str.IsEmpty()) + setWString(hContact, "City", str); + + str = homeAddress["country"].as_mstring(); + if (!str.IsEmpty()) + setWString(hContact, "Country", str); + } } CheckNickChange(hContact, buddy); |