From 559dbc7b53b097c0beb326bf82302aaed6cfa0a8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 31 Jul 2022 20:07:18 +0300 Subject: =?UTF-8?q?fixes=20#3130=20(WhenWasIt=20=D0=B2=D0=B5=D0=B4=D1=91?= =?UTF-8?q?=D1=82=20=D1=81=D0=B5=D0=B1=D1=8F=20=D1=81=D1=82=D1=80=D0=B0?= =?UTF-8?q?=D0=BD=D0=BD=D0=BE)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/stduserinfo/src/stdinfo.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/core') diff --git a/src/core/stduserinfo/src/stdinfo.cpp b/src/core/stduserinfo/src/stdinfo.cpp index 0a81dd8d3e..eb11d5807b 100644 --- a/src/core/stduserinfo/src/stdinfo.cpp +++ b/src/core/stduserinfo/src/stdinfo.cpp @@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define SVS_TIMEZONE 7 #define SVS_MARITAL 8 -static void SetValue(HWND m_hwnd, int idCtrl, MCONTACT hContact, char *szModule, char *szSetting, int special) +static void SetValue(HWND m_hwnd, int idCtrl, MCONTACT hContact, const char *szModule, char *szSetting, int special) { char *pstr = nullptr; wchar_t *pwstr = nullptr, wstr[80]; @@ -204,7 +204,7 @@ public: bool OnRefresh() override { - char *szProto = Proto_GetBaseAccountName(m_hContact); + const char *szProto = Proto_GetBaseAccountName(m_hContact); if (szProto == nullptr) return false; @@ -214,10 +214,12 @@ public: SetValue(m_hwnd, IDC_EMAIL, m_hContact, szProto, "e-mail", 0); SetValue(m_hwnd, IDC_AGE, m_hContact, szProto, "Age", SVS_ZEROISUNSPEC); SetValue(m_hwnd, IDC_GENDER, m_hContact, szProto, "Gender", SVS_GENDER); - SetValue(m_hwnd, IDC_DOBDAY, m_hContact, szProto, "BirthDay", 0); - SetValue(m_hwnd, IDC_DOBMONTH, m_hContact, szProto, "BirthMonth", SVS_MONTH); - SetValue(m_hwnd, IDC_DOBYEAR, m_hContact, szProto, "BirthYear", 0); SetValue(m_hwnd, IDC_MARITAL, m_hContact, szProto, "MaritalStatus", SVS_MARITAL); + + const char *szModule = (-1 == db_get_dw(m_hContact, "UserInfo", "BirthDay", -1)) ? szProto : "UserInfo"; + SetValue(m_hwnd, IDC_DOBDAY, m_hContact, szModule, "BirthDay", 0); + SetValue(m_hwnd, IDC_DOBMONTH, m_hContact, szModule, "BirthMonth", SVS_MONTH); + SetValue(m_hwnd, IDC_DOBYEAR, m_hContact, szModule, "BirthYear", 0); return false; } -- cgit v1.2.3