From bf37d6655a27cc3ea5af5412c9717596c9d1c30f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 19 Jun 2015 18:18:13 +0000 Subject: timezone api migrated to mir_core git-svn-id: http://svn.miranda-ng.org/main/trunk@14266 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TipperYM/src/subst.cpp | 8 ++---- plugins/TipperYM/src/tipper.cpp | 2 -- plugins/TipperYM/src/translations.cpp | 50 ++++++++++++----------------------- 3 files changed, 19 insertions(+), 41 deletions(-) (limited to 'plugins/TipperYM/src') diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp index 15310e474d..0d97d50af1 100644 --- a/plugins/TipperYM/src/subst.cpp +++ b/plugins/TipperYM/src/subst.cpp @@ -134,12 +134,8 @@ DWORD LastMessageTimestamp(MCONTACT hContact, bool received) void FormatTimestamp(DWORD ts, char *szFormat, TCHAR *buff, int bufflen) { TCHAR swzForm[16]; - DBTIMETOSTRINGT dbt = {0}; - dbt.cbDest = bufflen; - dbt.szDest = buff; a2t(szFormat, swzForm, 16); - dbt.szFormat = swzForm; - CallService(MS_DB_TIME_TIMESTAMPTOSTRINGT, (WPARAM)ts, (LPARAM)&dbt); + TimeZone_ToStringT(ts, swzForm, buff, bufflen); } bool Uid(MCONTACT hContact, char *szProto, TCHAR *buff, int bufflen) @@ -280,7 +276,7 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff } } else if (!mir_tstrcmp(swzRawSpec, _T("time"))) { - if (tmi.printDateTime && !tmi.printDateTimeByContact(hContact, _T("t"), buff, bufflen, TZF_KNOWNONLY)) + if (!printDateTimeByContact(hContact, _T("t"), buff, bufflen, TZF_KNOWNONLY)) return true; } else if (!mir_tstrcmp(swzRawSpec, _T("uidname"))) { diff --git a/plugins/TipperYM/src/tipper.cpp b/plugins/TipperYM/src/tipper.cpp index a8c6e68194..bc94a4a38c 100644 --- a/plugins/TipperYM/src/tipper.cpp +++ b/plugins/TipperYM/src/tipper.cpp @@ -37,7 +37,6 @@ TCHAR SKIN_FOLDER[256]; CLIST_INTERFACE *pcli = NULL; FI_INTERFACE *fii = NULL; -TIME_API tmi; int hLangpack; PLUGININFOEX pluginInfoEx = @@ -299,7 +298,6 @@ extern "C" int __declspec(dllexport) Load(void) CallService(MS_IMG_GETINTERFACE, FI_IF_VERSION, (LPARAM)&fii); mir_getLP(&pluginInfoEx); mir_getCLI(); - mir_getTMI(&tmi); iCodePage = Langpack_GetDefaultCodePage(); diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp index 12ac692831..e492d4bbf8 100644 --- a/plugins/TipperYM/src/translations.cpp +++ b/plugins/TipperYM/src/translations.cpp @@ -70,59 +70,43 @@ TCHAR *NullTranslation(MCONTACT hContact, const char *szModuleName, const char * return NULL; } -TCHAR *TimestampToShortDate(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen) +TCHAR* TimestampToShortDate(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen) { DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0); - if (ts == 0) return 0; + if (ts == 0) + return 0; - DBTIMETOSTRINGT dbt = {0}; - dbt.cbDest = bufflen; - dbt.szDest = buff; - dbt.szFormat = _T("d"); - CallService(MS_DB_TIME_TIMESTAMPTOSTRINGT, (WPARAM)ts, (LPARAM)&dbt); - return buff; + return TimeZone_ToStringT(ts, _T("d"), buff, bufflen); } -TCHAR *TimestampToLongDate(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen) +TCHAR* TimestampToLongDate(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen) { DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0); - if (ts == 0) return 0; + if (ts == 0) + return 0; - DBTIMETOSTRINGT dbt = {0}; - dbt.cbDest = bufflen; - dbt.szDest = buff; - dbt.szFormat = _T("D"); - CallService(MS_DB_TIME_TIMESTAMPTOSTRINGT, (WPARAM)ts, (LPARAM)&dbt); - return buff; + return TimeZone_ToStringT(ts, _T("D"), buff, bufflen); } -TCHAR *TimestampToTime(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen) +TCHAR* TimestampToTime(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen) { DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0); - if (ts == 0) return 0; + if (ts == 0) + return 0; - DBTIMETOSTRINGT dbt = {0}; - dbt.cbDest = bufflen; - dbt.szDest = buff; - dbt.szFormat = _T("s"); - CallService(MS_DB_TIME_TIMESTAMPTOSTRINGT, (WPARAM)ts, (LPARAM)&dbt); - return buff; + return TimeZone_ToStringT(ts, _T("s"), buff, bufflen); } -TCHAR *TimestampToTimeNoSecs(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen) +TCHAR* TimestampToTimeNoSecs(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen) { DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0); - if (ts == 0) return 0; + if (ts == 0) + return 0; - DBTIMETOSTRINGT dbt = {0}; - dbt.cbDest = bufflen; - dbt.szDest = buff; - dbt.szFormat = _T("t"); - CallService(MS_DB_TIME_TIMESTAMPTOSTRINGT, (WPARAM)ts, (LPARAM)&dbt); - return buff; + return TimeZone_ToStringT(ts, _T("t"), buff, bufflen); } -TCHAR *TimestampToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen) +TCHAR* TimestampToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen) { DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0); DWORD t = (DWORD)time(0); -- cgit v1.2.3