diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-08-16 14:23:35 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-08-16 14:23:35 +0000 |
commit | 108e6336657baa03d86659944b1e96c201379ac5 (patch) | |
tree | 15db33506fbbb82729e50e3d958f2f8745f6b078 /protocols/SkypeWeb | |
parent | 0e9b3d2bca89aaf1a365b6dbecff60c1b41aa28d (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')
-rw-r--r-- | protocols/SkypeWeb/src/skype_messages.cpp | 22 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.cpp | 6 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.h | 2 |
3 files changed, 22 insertions, 8 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
{
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp index bc9f1460a7..28d75c7b29 100644 --- a/protocols/SkypeWeb/src/skype_proto.cpp +++ b/protocols/SkypeWeb/src/skype_proto.cpp @@ -18,7 +18,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdafx.h"
CSkypeProto::CSkypeProto(const char* protoName, const TCHAR* userName) :
- PROTO<CSkypeProto>(protoName, userName), m_PopupClasses(1), m_InviteDialogs(1), m_GCCreateDialogs(1), m_OutMessages(3, PtrKeySortT)
+ PROTO<CSkypeProto>(protoName, userName),
+ m_PopupClasses(1),
+ m_InviteDialogs(1),
+ m_GCCreateDialogs(1),
+ m_OutMessages(3, PtrKeySortT)
{
m_hProtoIcon = Icons[0].Handle;
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h index dc1a15cb5b..69051e4afb 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -118,6 +118,7 @@ private: LIST<CSkypeGCCreateDlg> m_GCCreateDialogs;
//locks
+ mir_cs m_lckOutMessagesList;
mir_cs m_InviteDialogsLock;
mir_cs m_GCCreateDialogsLock;
mir_cs messageSyncLock;
@@ -262,6 +263,7 @@ private: void SyncHistory();
//chats
+
void InitGroupChatModule();
void CloseAllChatChatSessions();
|