From cf07690cddca7d8e7fd92219897bca5b12c87aa7 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Mon, 20 Apr 2015 08:33:41 +0000 Subject: SkypeWeb: Small improvement. git-svn-id: http://svn.miranda-ng.org/main/trunk@12958 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_history_sync.cpp | 8 +++++++- protocols/SkypeWeb/src/skype_messages.cpp | 9 +++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/protocols/SkypeWeb/src/skype_history_sync.cpp b/protocols/SkypeWeb/src/skype_history_sync.cpp index df5d4044a7..ed75061658 100644 --- a/protocols/SkypeWeb/src/skype_history_sync.cpp +++ b/protocols/SkypeWeb/src/skype_history_sync.cpp @@ -125,7 +125,13 @@ void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response) if (iType == 1) text.Append(Translate("Call started")); else if (iType == 0) - text.AppendFormat("%s\n%s: %d", Translate("Call ended"), Translate("Duration"), iDuration != NULL ? iDuration : 0); + { + int hours=0, mins=0, sec=0; + hours = iDuration != NULL ? iDuration / 3600 : 0; + mins = iDuration != NULL ? iDuration / 60 : 0; + sec = iDuration != NULL ? iDuration % 60 : 0; + text.AppendFormat("%s\n%s: %d:%d:%d", Translate("Call ended"), Translate("Duration"), hours, mins, sec); + } AddMessageToDb(hContact, timestamp, flags, clientMsgId, text.GetBuffer()); } } diff --git a/protocols/SkypeWeb/src/skype_messages.cpp b/protocols/SkypeWeb/src/skype_messages.cpp index 33d0944ad7..bc0aa74669 100644 --- a/protocols/SkypeWeb/src/skype_messages.cpp +++ b/protocols/SkypeWeb/src/skype_messages.cpp @@ -284,8 +284,13 @@ void CSkypeProto::OnPrivateMessageEvent(JSONNODE *node) if (iType == 1) text.Append(Translate("Call started")); else if (iType == 0) - text.AppendFormat("%s\n%s: %d", Translate("Call ended"), Translate("Duration"), iDuration != NULL ? iDuration : 0); - + { + int hours=0, mins=0, sec=0; + hours = iDuration != NULL ? iDuration / 3600 : 0; + mins = iDuration != NULL ? iDuration / 60 : 0; + sec = iDuration != NULL ? iDuration % 60 : 0; + text.AppendFormat("%s\n%s: %d:%d:%d", Translate("Call ended"), Translate("Duration"), hours, mins, sec); + } if (IsMe(from)) AddMessageToDb(hContact, timestamp, DBEF_UTF | DBEF_SENT, clientMsgId, text.GetBuffer()); else -- cgit v1.2.3