diff options
| author | George Hazan <george.hazan@gmail.com> | 2025-03-20 17:15:42 +0300 |
|---|---|---|
| committer | George Hazan <george.hazan@gmail.com> | 2025-03-20 17:15:42 +0300 |
| commit | b07063023ffb6bac667bb865e4d30212b88ff8e2 (patch) | |
| tree | 3ab8ee290d8cdfe25f1ef0c5bc6f1127367a3be0 /protocols/SkypeWeb | |
| parent | 0be93f29ef172bc008e4b5787f3d01a39c06dad9 (diff) | |
core helper for setting birthday & age
Diffstat (limited to 'protocols/SkypeWeb')
| -rw-r--r-- | protocols/SkypeWeb/src/skype_contacts.cpp | 7 | ||||
| -rw-r--r-- | protocols/SkypeWeb/src/skype_profile.cpp | 5 |
2 files changed, 4 insertions, 8 deletions
diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index a96a25262d..daed188bb2 100644 --- a/protocols/SkypeWeb/src/skype_contacts.cpp +++ b/protocols/SkypeWeb/src/skype_contacts.cpp @@ -189,11 +189,8 @@ void CSkypeProto::LoadContactList(MHttpResponse *response, AsyncHttpRequest*) auto wstr = profile["birthday"].as_mstring();
if (!wstr.IsEmpty() ) {
int nYear, nMonth, nDay;
- if (swscanf(wstr, L"%d-%d-%d", &nYear, &nMonth, &nDay) == 3) {
- setWord(hContact, "BirthYear", nYear);
- setByte(hContact, "BirthMonth", nMonth);
- setByte(hContact, "BirthDay", nDay);
- }
+ if (swscanf(wstr, L"%d-%d-%d", &nYear, &nMonth, &nDay) == 3)
+ Contact::SetBirthday(hContact, nDay, nMonth, nYear);
}
wstr = profile["gender"].as_mstring();
diff --git a/protocols/SkypeWeb/src/skype_profile.cpp b/protocols/SkypeWeb/src/skype_profile.cpp index f6ca94ef30..5bfcd49513 100644 --- a/protocols/SkypeWeb/src/skype_profile.cpp +++ b/protocols/SkypeWeb/src/skype_profile.cpp @@ -50,9 +50,8 @@ void CSkypeProto::UpdateProfileBirthday(const JSONNode &root, MCONTACT hContact) if (!birthday.IsEmpty() && birthday != "null") {
int d, m, y;
if (3 == swscanf(birthday.GetBuffer(), L"%d-%d-%d", &y, &m, &d)) {
- setWord(hContact, "BirthYear", y);
- setByte(hContact, "BirthDay", d);
- setByte(hContact, "BirthMonth", m);
+ Contact::SetBirthday(hContact, d, m, y);
+ return;
}
}
|
