From f42360672d6cb4cff042a6a2426fb767dcd55d8c Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Wed, 24 Jun 2015 19:52:16 +0000 Subject: SkypeWeb: Call duration fix. git-svn-id: http://svn.miranda-ng.org/main/trunk@14368 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_history_sync.cpp | 2 +- protocols/SkypeWeb/src/skype_messages.cpp | 11 ++++++++++- protocols/SkypeWeb/src/stdafx.h | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) (limited to 'protocols/SkypeWeb') diff --git a/protocols/SkypeWeb/src/skype_history_sync.cpp b/protocols/SkypeWeb/src/skype_history_sync.cpp index ef57c93e8a..9638e278a8 100644 --- a/protocols/SkypeWeb/src/skype_history_sync.cpp +++ b/protocols/SkypeWeb/src/skype_history_sync.cpp @@ -131,7 +131,7 @@ void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response) if (iDuration != NULL) { hours = iDuration / 3600; - mins = iDuration / 60; + mins = ((iDuration / 60) - (hours * 60)); sec = iDuration % 60; } else diff --git a/protocols/SkypeWeb/src/skype_messages.cpp b/protocols/SkypeWeb/src/skype_messages.cpp index 240d57cf73..baf3d242c3 100644 --- a/protocols/SkypeWeb/src/skype_messages.cpp +++ b/protocols/SkypeWeb/src/skype_messages.cpp @@ -67,6 +67,14 @@ int CSkypeProto::OnSendMessage(MCONTACT hContact, int, const char *szMessage) debugLogA(__FUNCTION__ " clientmsgid = %d", param->hMessage); + /*TCHAR *tszMessage = mir_utf8decodeT(szMessage); + int len = EscapeXML(tszMessage, _tcslen(tszMessage), NULL, 0); + TCHAR *buff = new TCHAR[len+1]; + buff[len] = '\0'; + EscapeXML(tszMessage, _tcslen(tszMessage), buff, len); + char *szNewMessage = mir_utf8encodeT(buff); + delete[] buff;*/ + if (strncmp(szMessage, "/me ", 4) == 0) SendRequest(new SendActionRequest(m_szRegToken, m_szSelfSkypeName, param->hMessage, &szMessage[4], m_szServer), &CSkypeProto::OnMessageSent, param); else @@ -223,10 +231,11 @@ void CSkypeProto::OnPrivateMessageEvent(const JSONNode &node) { CMStringA chours = "", cmins = "", csec = ""; int hours = 0, mins = 0, sec = 0; + if (iDuration != NULL) { hours = iDuration / 3600; - mins = iDuration / 60; + mins = ((iDuration / 60) - (hours * 60)); sec = iDuration % 60; } else diff --git a/protocols/SkypeWeb/src/stdafx.h b/protocols/SkypeWeb/src/stdafx.h index bdc07e528a..a2be43094b 100644 --- a/protocols/SkypeWeb/src/stdafx.h +++ b/protocols/SkypeWeb/src/stdafx.h @@ -26,7 +26,7 @@ along with this program. If not, see . #include #include #include - +#include #include #include -- cgit v1.2.3