summaryrefslogtreecommitdiff
path: root/protocols/WhatsApp
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2014-08-29 20:26:11 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2014-08-29 20:26:11 +0000
commitd8e0b2d36e1944ab747012ed7ba4612f0da48854 (patch)
tree1cac093c289503b33103cda30f037c2af044b5ff /protocols/WhatsApp
parentd49df717ef089662383a271b45937aafda6399d8 (diff)
WhatsApp: Changed formatting of status message
git-svn-id: http://svn.miranda-ng.org/main/trunk@10338 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp')
-rw-r--r--protocols/WhatsApp/src/contacts.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/protocols/WhatsApp/src/contacts.cpp b/protocols/WhatsApp/src/contacts.cpp
index 49cdca0982..533f8c32ba 100644
--- a/protocols/WhatsApp/src/contacts.cpp
+++ b/protocols/WhatsApp/src/contacts.cpp
@@ -276,11 +276,16 @@ void WhatsAppProto::UpdateStatusMsg(MCONTACT hContact)
if (lastSeen != -1)
{
time_t timestamp = time(NULL) - lastSeen;
-
- tm* t = localtime(&timestamp);
- ss << _T("Last seen on ") << std::setfill(_T('0')) << std::setw(2) << (t->tm_mon + 1) <<
- _T("/") << std::setw(2) << t->tm_mday << _T("/") << (t->tm_year + 1900) << _T(" ")
- << std::setw(2) << t->tm_hour << _T(":") << std::setw(2) << t->tm_min;
+
+ FILETIME ft;
+ UnixTimeToFileTime(timestamp, &ft);
+ SYSTEMTIME st;
+ FileTimeToSystemTime(&ft, &st);
+
+ TCHAR stzDate[MAX_PATH], stzTime[MAX_PATH];
+ GetTimeFormat(LOCALE_USER_DEFAULT, 0, &st,0, stzTime, SIZEOF(stzTime));
+ GetDateFormat(LOCALE_USER_DEFAULT, 0, &st,0, stzDate, SIZEOF(stzDate));
+ ss << TranslateT("Last seen on ") << stzDate << TranslateT(" at ") << stzTime;
}
int state = getDword(hContact, WHATSAPP_KEY_LAST_MSG_STATE, 2);