diff options
Diffstat (limited to 'plugins/TipperYM/src/subst.cpp')
-rw-r--r-- | plugins/TipperYM/src/subst.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp index efa18fbd4a..45e7abd4d5 100644 --- a/plugins/TipperYM/src/subst.cpp +++ b/plugins/TipperYM/src/subst.cpp @@ -119,7 +119,7 @@ void StripBBCodesInPlace(wchar_t *ptszText) } } -DWORD LastMessageTimestamp(MCONTACT hContact, bool received) +uint32_t LastMessageTimestamp(MCONTACT hContact, bool received) { for (MEVENT hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) { DBEVENTINFO dbei = {}; @@ -131,7 +131,7 @@ DWORD LastMessageTimestamp(MCONTACT hContact, bool received) return 0; } -void FormatTimestamp(DWORD ts, char *szFormat, wchar_t *buff, int bufflen) +void FormatTimestamp(uint32_t ts, char *szFormat, wchar_t *buff, int bufflen) { wchar_t swzForm[16]; a2t(szFormat, swzForm, 16); @@ -324,22 +324,22 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int return GetSysSubstText(hSubContact, L"account", buff, bufflen); } else if ((recv = !mir_wstrcmp(swzRawSpec, L"last_msg_time")) || !mir_wstrcmp(swzRawSpec, L"last_msg_out_time")) { - DWORD ts = LastMessageTimestamp(hContact, recv); + uint32_t ts = LastMessageTimestamp(hContact, recv); if (ts == 0) return false; FormatTimestamp(ts, "t", buff, bufflen); return true; } else if ((recv = !mir_wstrcmp(swzRawSpec, L"last_msg_date")) || !mir_wstrcmp(swzRawSpec, L"last_msg_out_date")) { - DWORD ts = LastMessageTimestamp(hContact, recv); + uint32_t ts = LastMessageTimestamp(hContact, recv); if (ts == 0) return false; FormatTimestamp(ts, "d", buff, bufflen); return true; } else if ((recv = !mir_wstrcmp(swzRawSpec, L"last_msg_reltime")) || !mir_wstrcmp(swzRawSpec, L"last_msg_out_reltime")) { - DWORD ts = LastMessageTimestamp(hContact, recv); + uint32_t ts = LastMessageTimestamp(hContact, recv); if (ts == 0) return false; - DWORD t = (DWORD)time(0); - DWORD diff = (t - ts); + uint32_t t = (uint32_t)time(0); + uint32_t diff = (t - ts); int d = (diff / 60 / 60 / 24); int h = (diff - d * 60 * 60 * 24) / 60 / 60; int m = (diff - d * 60 * 60 * 24 - h * 60 * 60) / 60; @@ -349,10 +349,10 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int return true; } else if (!mir_wstrcmp(swzRawSpec, L"msg_count_all") || !mir_wstrcmp(swzRawSpec, L"msg_count_out") || !mir_wstrcmp(swzRawSpec, L"msg_count_in")) { - DWORD dwCountOut, dwCountIn; - DWORD dwMetaCountOut = 0, dwMetaCountIn = 0; - DWORD dwLastTs, dwNewTs, dwRecountTs; - DWORD dwTime, dwDiff; + uint32_t dwCountOut, dwCountIn; + uint32_t dwMetaCountOut = 0, dwMetaCountIn = 0; + uint32_t dwLastTs, dwNewTs, dwRecountTs; + uint32_t dwTime, dwDiff; int iNumber = 1; MCONTACT hTmpContact = hContact; @@ -366,7 +366,7 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int if (i > 0) hTmpContact = db_mc_getSub(hContact, i); dwRecountTs = g_plugin.getDword(hTmpContact, "LastCountTS"); - dwTime = (DWORD)time(0); + dwTime = (uint32_t)time(0); dwDiff = (dwTime - dwRecountTs); if (dwDiff > (60 * 60 * 24 * 3)) { g_plugin.setDword(hTmpContact, "LastCountTS", dwTime); @@ -422,7 +422,7 @@ bool GetSubstText(MCONTACT hContact, const DISPLAYSUBST &ds, wchar_t *buff, int { TranslateFunc *transFunc = nullptr; for (int i = 0; i < iTransFuncsCount; i++) - if (translations[i].id == (DWORD)ds.iTranslateFuncId) { + if (translations[i].id == (uint32_t)ds.iTranslateFuncId) { transFunc = translations[i].transFunc; break; } |