summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2015-04-03 06:04:07 +0000
committerKirill Volinsky <mataes2007@gmail.com>2015-04-03 06:04:07 +0000
commit201ced87c58de8ee50cb15562506d700f51d09a1 (patch)
tree363d487910a8d3c99f040b6acd9ef03e473f457b
parenta50ae784ce7394b2621cf42a28cab7edd31e6c6a (diff)
fixed timestamp converting
git-svn-id: http://svn.miranda-ng.org/main/trunk@12582 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/SkypeWeb/src/skype_poll_processing.cpp6
-rw-r--r--protocols/SkypeWeb/src/skype_utils.cpp11
2 files changed, 13 insertions, 4 deletions
diff --git a/protocols/SkypeWeb/src/skype_poll_processing.cpp b/protocols/SkypeWeb/src/skype_poll_processing.cpp
index d357c5b5ee..23008451b7 100644
--- a/protocols/SkypeWeb/src/skype_poll_processing.cpp
+++ b/protocols/SkypeWeb/src/skype_poll_processing.cpp
@@ -80,9 +80,9 @@ void CSkypeProto::ProcessNewMessageRes(JSONNODE *node)
ptrA conversationLink(mir_t2a(ptrT(json_as_string(json_get(node, "conversationLink")))));
time_t timeStamp = IsoToUnixTime(composeTime);//time(NULL); // it should be rewritten
- PROTORECVEVENT recv = { 0 };
- recv.flags = PREF_UTF;
- recv.timestamp = timeStamp;
+ PROTORECVEVENT recv = { 0 };
+ recv.flags = PREF_UTF;
+ recv.timestamp = timeStamp;
recv.szMessage = content;
debugLogA("Incoming message from %s", ContactUrlToName(from));
if(IsMe(ContactUrlToName(from)))
diff --git a/protocols/SkypeWeb/src/skype_utils.cpp b/protocols/SkypeWeb/src/skype_utils.cpp
index a85f9c9eec..428f778d5b 100644
--- a/protocols/SkypeWeb/src/skype_utils.cpp
+++ b/protocols/SkypeWeb/src/skype_utils.cpp
@@ -8,7 +8,16 @@ time_t __stdcall CSkypeProto::IsoToUnixTime(const TCHAR *stamp)
if (stamp == NULL)
return 0;
- const TCHAR *p = stamp;
+ TCHAR *p = NEWTSTR_ALLOCA(stamp);
+
+ // skip '-' chars
+ int si = 0, sj = 0;
+ while (true) {
+ if (p[si] == _T('-'))
+ si++;
+ else if (!(p[sj++] = p[si++]))
+ break;
+ }
// Get the date part
for (i = 0; *p != '\0' && i < 8 && isdigit(*p); p++, i++)