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 --- protocols/ICQCorp/src/corp.h | 1 + protocols/ICQCorp/src/protocol.cpp | 4 ++-- protocols/ICQCorp/src/transfer.cpp | 2 +- protocols/IcqOscarJ/src/dlgproc.cpp | 4 ++-- protocols/IcqOscarJ/src/editlist.cpp | 4 ++-- protocols/IcqOscarJ/src/init.cpp | 2 -- protocols/JabberG/src/jabber.cpp | 2 -- protocols/JabberG/src/jabber_iq_handlers.cpp | 6 +++--- protocols/MSN/src/msn.cpp | 2 -- protocols/MSN/src/msn_auth.cpp | 4 ++-- protocols/SkypeWeb/src/main.cpp | 2 -- 11 files changed, 13 insertions(+), 20 deletions(-) (limited to 'protocols') diff --git a/protocols/ICQCorp/src/corp.h b/protocols/ICQCorp/src/corp.h index c703ee04ea..999ccaed64 100644 --- a/protocols/ICQCorp/src/corp.h +++ b/protocols/ICQCorp/src/corp.h @@ -39,6 +39,7 @@ #include #include #include +#include #include "user.h" #include "transfer.h" diff --git a/protocols/ICQCorp/src/protocol.cpp b/protocols/ICQCorp/src/protocol.cpp index 8a4967f5f1..76350c4f18 100644 --- a/protocols/ICQCorp/src/protocol.cpp +++ b/protocols/ICQCorp/src/protocol.cpp @@ -719,7 +719,7 @@ unsigned short ICQ::processUdpPacket(Packet &packet) >> newCommand; timeStampLastMessage = timedataStamp; - timedataStamp = CallService(MS_DB_TIME_TIMESTAMPTOLOCAL, timedataStamp, 0); + timedataStamp = TimeZone_ToLocal(timedataStamp); processSystemMessage(packet, checkUin, newCommand, timedataStamp); break; @@ -806,7 +806,7 @@ unsigned short ICQ::processUdpPacket(Packet &packet) >> newCommand; db_set_dw(NULL, protoName, "LastBroadcastTime", timedataStamp); - timedataStamp = CallService(MS_DB_TIME_TIMESTAMPTOLOCAL, timedataStamp, 0); + timedataStamp = TimeZone_ToLocal(timedataStamp); processSystemMessage(packet, checkUin, newCommand, timedataStamp); break; diff --git a/protocols/ICQCorp/src/transfer.cpp b/protocols/ICQCorp/src/transfer.cpp index c864c6b3e9..32058cc1f9 100644 --- a/protocols/ICQCorp/src/transfer.cpp +++ b/protocols/ICQCorp/src/transfer.cpp @@ -326,7 +326,7 @@ void ICQTransfer::ack(unsigned int result) fts.szCurrentFile = fileName; fts.currentFileSize = fileSize; fts.currentFileProgress = fileProgress; - fts.currentFileTime = CallService(MS_DB_TIME_TIMESTAMPTOLOCAL, fileDate, 0); + fts.currentFileTime = TimeZone_ToLocal(fileDate); /* switch (session->status) { diff --git a/protocols/IcqOscarJ/src/dlgproc.cpp b/protocols/IcqOscarJ/src/dlgproc.cpp index 517463bfd8..704764c848 100644 --- a/protocols/IcqOscarJ/src/dlgproc.cpp +++ b/protocols/IcqOscarJ/src/dlgproc.cpp @@ -77,8 +77,8 @@ char* ChangeInfoData::GetItemSettingText(int i, char *buf, size_t bufsize) FieldNamesItem *list = (FieldNamesItem*)si.pList; if (list == timezonesField) { - HANDLE tz = tmi.createByContact(NULL, ppro->m_szModuleName, 0); - text = make_utf8_string_static(tmi.getTzDescription(tmi.getTzName(tz)), buf, bufsize); + HANDLE tz = TimeZone_CreateByContact(NULL, ppro->m_szModuleName, 0); + text = make_utf8_string_static(TimeZone_GetDescription(TimeZone_GetName(tz)), buf, bufsize); break; } diff --git a/protocols/IcqOscarJ/src/editlist.cpp b/protocols/IcqOscarJ/src/editlist.cpp index da04c5efc1..df632256d5 100644 --- a/protocols/IcqOscarJ/src/editlist.cpp +++ b/protocols/IcqOscarJ/src/editlist.cpp @@ -99,7 +99,7 @@ void ChangeInfoData::BeginListEdit(int iItem, RECT *rc, int iSetting, WORD wVKey } if (list == timezonesField) { - tmi.prepareList(NULL, ppro->m_szModuleName, hwndListEdit, TZF_PLF_LB); + TimeZone_PrepareList(NULL, ppro->m_szModuleName, hwndListEdit, TZF_PLF_LB); } else { int j, n = ListBoxAddStringUtf(hwndListEdit, "Unspecified"); @@ -149,7 +149,7 @@ void ChangeInfoData::EndListEdit(int save) if (iItem != -1 && i != -1) { FieldNamesItem *list = (FieldNamesItem*)si.pList; if (list == timezonesField) { - tmi.storeListResults(NULL, ppro->m_szModuleName, hwndListEdit, TZF_PLF_LB); + TimeZone_StoreListResult(NULL, ppro->m_szModuleName, hwndListEdit, TZF_PLF_LB); list[i = 0].code = ppro->getDword("Timezone", 0); } diff --git a/protocols/IcqOscarJ/src/init.cpp b/protocols/IcqOscarJ/src/init.cpp index ddaec0e16c..e922d09cfa 100644 --- a/protocols/IcqOscarJ/src/init.cpp +++ b/protocols/IcqOscarJ/src/init.cpp @@ -30,7 +30,6 @@ HINSTANCE hInst; int hLangpack; -TIME_API tmi; CLIST_INTERFACE *pcli; bool g_bTerminated; @@ -96,7 +95,6 @@ extern "C" int __declspec(dllexport) Load(void) { mir_getLP(&pluginInfo); mir_getCLI(); - mir_getTMI(&tmi); srand(time(NULL)); _tzset(); diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp index caedaddab5..697dcfa3da 100644 --- a/protocols/JabberG/src/jabber.cpp +++ b/protocols/JabberG/src/jabber.cpp @@ -59,7 +59,6 @@ PLUGININFOEX pluginInfo = { }; XML_API xi; -TIME_API tmi; CLIST_INTERFACE* pcli; FI_INTERFACE *FIP = NULL; @@ -184,7 +183,6 @@ extern "C" int __declspec(dllexport) Load() { // set the memory, lists & utf8 managers mir_getXI(&xi); - mir_getTMI(&tmi); mir_getLP(&pluginInfo); mir_getCLI(); diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp index d239ae052c..c2b6dc5c67 100644 --- a/protocols/JabberG/src/jabber_iq_handlers.cpp +++ b/protocols/JabberG/src/jabber_iq_handlers.cpp @@ -393,7 +393,7 @@ BOOL CJabberProto::OnIqRequestTime(HXML, CJabberIqInfo *pInfo) TCHAR stime[100]; TCHAR szTZ[10]; - tmi.printDateTime(UTC_TIME_HANDLE, _T("I"), stime, SIZEOF(stime), 0); + TimeZone_PrintDateTime(UTC_TIME_HANDLE, _T("I"), stime, SIZEOF(stime), 0); int nGmtOffset = GetGMTOffset(); mir_sntprintf(szTZ, SIZEOF(szTZ), _T("%+03d:%02d"), nGmtOffset / 60, nGmtOffset % 60); @@ -401,7 +401,7 @@ BOOL CJabberProto::OnIqRequestTime(HXML, CJabberIqInfo *pInfo) XmlNodeIq iq(_T("result"), pInfo); HXML timeNode = iq << XCHILDNS(_T("time"), JABBER_FEAT_ENTITY_TIME); timeNode << XCHILD(_T("utc"), stime); timeNode << XCHILD(_T("tzo"), szTZ); - LPCTSTR szTZName = tmi.getTzName(NULL); + LPCTSTR szTZName = TimeZone_GetName(NULL); if (szTZName) timeNode << XCHILD(_T("tz"), szTZName); m_ThreadInfo->send(iq); @@ -426,7 +426,7 @@ BOOL CJabberProto::OnIqProcessIqOldTime(HXML, CJabberIqInfo *pInfo) XmlNodeIq iq(_T("result"), pInfo); HXML queryNode = iq << XQUERY(JABBER_FEAT_ENTITY_TIME_OLD); queryNode << XCHILD(_T("utc"), stime); - LPCTSTR szTZName = tmi.getTzName(NULL); + LPCTSTR szTZName = TimeZone_GetName(NULL); if (szTZName) queryNode << XCHILD(_T("tz"), szTZName); queryNode << XCHILD(_T("display"), dtime); diff --git a/protocols/MSN/src/msn.cpp b/protocols/MSN/src/msn.cpp index ec7f204449..1b0f0b43a6 100644 --- a/protocols/MSN/src/msn.cpp +++ b/protocols/MSN/src/msn.cpp @@ -27,7 +27,6 @@ along with this program. If not, see . HINSTANCE hInst; int hLangpack; -TIME_API tmi; ///////////////////////////////////////////////////////////////////////////////////////// // Initialization routines @@ -111,7 +110,6 @@ static int msnProtoUninit(CMsnProto* ppro) extern "C" int __declspec(dllexport) Load(void) { - mir_getTMI(&tmi); mir_getLP(&pluginInfo); HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); diff --git a/protocols/MSN/src/msn_auth.cpp b/protocols/MSN/src/msn_auth.cpp index 4dbd10237a..c6c9209b89 100644 --- a/protocols/MSN/src/msn_auth.cpp +++ b/protocols/MSN/src/msn_auth.cpp @@ -153,8 +153,8 @@ int CMsnProto::MSN_GetPassportAuth(void) time_t ts = time(NULL); TCHAR szTs1[64], szTs2[64]; - tmi.printTimeStamp(UTC_TIME_HANDLE, ts, _T("I"), szTs1, SIZEOF(szTs1), 0); - tmi.printTimeStamp(UTC_TIME_HANDLE, ts + 20 * 60, _T("I"), szTs2, SIZEOF(szTs2), 0); + TimeZone_PrintTimeStamp(UTC_TIME_HANDLE, ts, _T("I"), szTs1, SIZEOF(szTs1), 0); + TimeZone_PrintTimeStamp(UTC_TIME_HANDLE, ts + 20 * 60, _T("I"), szTs2, SIZEOF(szTs2), 0); CMStringA szAuthInfo(FORMAT, authPacket, int(ts), MyOptions.szEmail, ptrA(HtmlEncode(szPassword)), szTs1, szTs2); diff --git a/protocols/SkypeWeb/src/main.cpp b/protocols/SkypeWeb/src/main.cpp index 103306d981..0d09d03e32 100644 --- a/protocols/SkypeWeb/src/main.cpp +++ b/protocols/SkypeWeb/src/main.cpp @@ -19,7 +19,6 @@ along with this program. If not, see . int hLangpack; XML_API xi; -TIME_API tmi = { 0 }; HINSTANCE g_hInstance; CLIST_INTERFACE *pcli; char g_szMirVer[100]; @@ -55,7 +54,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC extern "C" int __declspec(dllexport) Load(void) { - mir_getTMI(&tmi); mir_getLP(&pluginInfo); mir_getXI(&xi); mir_getCLI(); -- cgit v1.2.3