summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2025-03-20 17:15:42 +0300
committerGeorge Hazan <george.hazan@gmail.com>2025-03-20 17:15:42 +0300
commitb07063023ffb6bac667bb865e4d30212b88ff8e2 (patch)
tree3ab8ee290d8cdfe25f1ef0c5bc6f1127367a3be0 /protocols/JabberG/src
parent0be93f29ef172bc008e4b5787f3d01a39c06dad9 (diff)
core helper for setting birthday & age
Diffstat (limited to 'protocols/JabberG/src')
-rw-r--r--protocols/JabberG/src/jabber_iqid.cpp12
1 files changed, 1 insertions, 11 deletions
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp
index 5e0a2b47ed..431f9d26a0 100644
--- a/protocols/JabberG/src/jabber_iqid.cpp
+++ b/protocols/JabberG/src/jabber_iqid.cpp
@@ -760,17 +760,7 @@ void CJabberProto::OnIqResultGetVcard(const TiXmlElement *iqNode, CJabberIqInfo*
if (hContact != 0) {
if (sscanf(n->GetText(), "%d-%d-%d", &nYear, &nMonth, &nDay) == 3) {
hasBday = true;
- setWord(hContact, "BirthYear", (uint16_t)nYear);
- setByte(hContact, "BirthMonth", (uint8_t)nMonth);
- setByte(hContact, "BirthDay", (uint8_t)nDay);
-
- SYSTEMTIME sToday = { 0 };
- GetLocalTime(&sToday);
- int nAge = sToday.wYear - nYear;
- if (sToday.wMonth < nMonth || (sToday.wMonth == nMonth && sToday.wDay < nDay))
- nAge--;
- if (nAge)
- setWord(hContact, "Age", (uint16_t)nAge);
+ Contact::SetBirthday(hContact, nDay, nMonth, nYear);
}
}
else {