summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_messages.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/SkypeWeb/src/skype_messages.cpp')
-rw-r--r--protocols/SkypeWeb/src/skype_messages.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/protocols/SkypeWeb/src/skype_messages.cpp b/protocols/SkypeWeb/src/skype_messages.cpp
index 21d04586f3..aef8687f78 100644
--- a/protocols/SkypeWeb/src/skype_messages.cpp
+++ b/protocols/SkypeWeb/src/skype_messages.cpp
@@ -285,11 +285,21 @@ void CSkypeProto::OnPrivateMessageEvent(JSONNODE *node)
text.Append(Translate("Call started"));
else if (iType == 0)
{
+ CMStringA chours = "", cmins = "", csec = "";
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 (iDuration != NULL)
+ {
+ hours = iDuration / 3600;
+ mins = iDuration / 60;
+ sec = iDuration % 60;
+ }
+ else
+ hours=mins=sec=0;
+
+ if (hours < 10) chours.AppendFormat("0%d", hours); else chours.AppendFormat("%d", hours);
+ if (mins < 10) cmins.AppendFormat("0%d", mins); else cmins.AppendFormat("%d", mins);
+ if (sec < 10) csec.AppendFormat("0%d", sec); else csec.AppendFormat("%d", sec);
+ text.AppendFormat("%s\n%s: %s:%s:%s", Translate("Call ended"), Translate("Duration"), chours, cmins, csec);
}
if (IsMe(from))
AddMessageToDb(hContact, timestamp, DBEF_UTF | DBEF_SENT, clientMsgId, text.GetBuffer());