summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_messages.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-08-16 14:23:35 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-08-16 14:23:35 +0000
commit108e6336657baa03d86659944b1e96c201379ac5 (patch)
tree15db33506fbbb82729e50e3d958f2f8745f6b078 /protocols/SkypeWeb/src/skype_messages.cpp
parent0e9b3d2bca89aaf1a365b6dbecff60c1b41aa28d (diff)
SkypeWeb: fix for messages timestamp
git-svn-id: http://svn.miranda-ng.org/main/trunk@14965 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_messages.cpp')
-rw-r--r--protocols/SkypeWeb/src/skype_messages.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/protocols/SkypeWeb/src/skype_messages.cpp b/protocols/SkypeWeb/src/skype_messages.cpp
index ba3c7eb5aa..2b7733c849 100644
--- a/protocols/SkypeWeb/src/skype_messages.cpp
+++ b/protocols/SkypeWeb/src/skype_messages.cpp
@@ -48,7 +48,7 @@ int CSkypeProto::OnSendMessage(MCONTACT hContact, int, const char *szMessage)
{
if (!IsOnline())
{
- ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)"You cannot send when you are offline.");
+ ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)Translate("You cannot send when you are offline."));
return 0;
}
@@ -63,8 +63,10 @@ int CSkypeProto::OnSendMessage(MCONTACT hContact, int, const char *szMessage)
else
SendRequest(new SendMessageRequest(username, param->hMessage, szMessage, li), &CSkypeProto::OnMessageSent, param);
- m_OutMessages.insert((void*)param->hMessage);
-
+ {
+ mir_cslock lck(m_lckOutMessagesList);
+ m_OutMessages.insert((void*)param->hMessage);
+ }
return param->hMessage;
}
@@ -87,11 +89,14 @@ void CSkypeProto::OnMessageSent(const NETLIBHTTPREQUEST *response, void *arg)
auto it = m_mpOutMessages.find(hMessage);
if (it == m_mpOutMessages.end())
{
- m_mpOutMessages[hMessage] = jRoot["OriginalArrivalTime"].as_int();
+ m_mpOutMessages[hMessage] = (jRoot["OriginalArrivalTime"].as_int() / 1000);
}
}
ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, hMessage, 0);
- m_OutMessages.remove(hMessage);
+ {
+ mir_cslock lck(m_lckOutMessagesList);
+ m_OutMessages.remove(hMessage);
+ }
}
}
else
@@ -182,7 +187,7 @@ void CSkypeProto::OnPrivateMessageEvent(const JSONNode &node)
{
if (IsMe(szFromSkypename))
{
- HANDLE hMessage = (HANDLE)atol(szMessageId);
+ HANDLE hMessage = (HANDLE)std::stoll(szMessageId.GetString());
if (m_OutMessages.getIndex(hMessage) != -1)
{
auto it = m_mpOutMessages.find(hMessage);
@@ -191,7 +196,10 @@ void CSkypeProto::OnPrivateMessageEvent(const JSONNode &node)
m_mpOutMessages[hMessage] = timestamp;
}
ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, hMessage, 0);
- m_OutMessages.remove(hMessage);
+ {
+ mir_cslock lck(m_lckOutMessagesList);
+ m_OutMessages.remove(hMessage);
+ }
}
else
{