diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-07-27 10:28:20 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-07-27 10:28:20 +0000 |
commit | 1a0cc38136914d475df14be27198fb2b88494cb8 (patch) | |
tree | cca4e5f96a0cbec8a08fcdb51420c6c1f1ea7f57 /protocols/SkypeWeb/src/skype_history_sync.cpp | |
parent | 8b77c1ba74a24af5ec831385fc876807aed509c0 (diff) |
SkypeWeb: *YAHOO* fixed edited messages sync, other fixes.
git-svn-id: http://svn.miranda-ng.org/main/trunk@14735 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_history_sync.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_history_sync.cpp | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/protocols/SkypeWeb/src/skype_history_sync.cpp b/protocols/SkypeWeb/src/skype_history_sync.cpp index 4d70e23d99..1016bd3e1c 100644 --- a/protocols/SkypeWeb/src/skype_history_sync.cpp +++ b/protocols/SkypeWeb/src/skype_history_sync.cpp @@ -43,8 +43,8 @@ void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response) {
const JSONNode &message = conversations.at(i);
- std::string clientMsgId = message["clientmessageid"].as_string();
- std::string skypeEditedId = message["skypeeditedid"].as_string();
+ CMStringA szMessageId = message["clientmessageid"] ? message["clientmessageid"].as_string().c_str() : message["skypeeditedid"].as_string().c_str();
+
std::string messageType = message["messagetype"].as_string();
std::string from = message["from"].as_string();
std::string content = message["content"].as_string();
@@ -60,38 +60,42 @@ void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response) if (timestamp > db_get_dw(hContact, m_szModuleName, "LastMsgTime", 0))
db_set_dw(hContact, m_szModuleName, "LastMsgTime", (DWORD)timestamp);
- int flags = DBEF_UTF;
+ int iFlags = DBEF_UTF;
if (!markAllAsUnread)
- flags |= DBEF_READ;
+ iFlags |= DBEF_READ;
if (IsMe(skypename))
- flags |= DBEF_SENT;
+ iFlags |= DBEF_SENT;
if (strstr(conversationLink.c_str(), "/8:"))
{
- if (!mir_strcmpi(messageType.c_str(), "Text") || !mir_strcmpi(messageType.c_str(), "RichText"))
+ if (messageType == "Text" || messageType == "RichText")
{
ptrA message(RemoveHtml(content.c_str()));
- MEVENT dbevent = GetMessageFromDb(hContact, skypeEditedId.c_str());
+ MEVENT dbevent = GetMessageFromDb(hContact, szMessageId);
if (isEdited && dbevent != NULL)
{
- AppendDBEvent(hContact, dbevent, message, clientMsgId.c_str(), timestamp);
+ AppendDBEvent(hContact, dbevent, message, szMessageId, timestamp);
}
- else AddDbEvent(EVENTTYPE_MESSAGE, hContact, timestamp, flags, &message[emoteOffset], clientMsgId.c_str());
+ else AddDbEvent(emoteOffset == 0 ? EVENTTYPE_MESSAGE : SKYPE_DB_EVENT_TYPE_ACTION, hContact, timestamp, iFlags, &message[emoteOffset], szMessageId);
+ }
+ else if (messageType == "Event/Call")
+ {
+ AddDbEvent(SKYPE_DB_EVENT_TYPE_CALL_INFO, hContact, timestamp, iFlags, content.c_str(), szMessageId);
}
- else if (!mir_strcmpi(messageType.c_str(), "Event/Call"))
+ else if (messageType == "RichText/Files")
{
- AddDbEvent(SKYPE_DB_EVENT_TYPE_CALL_INFO, hContact, timestamp, DBEF_UTF, content.c_str(), clientMsgId.c_str());
+ AddDbEvent(SKYPE_DB_EVENT_TYPE_FILETRANSFER_INFO, hContact, timestamp, iFlags, content.c_str(), szMessageId);
}
- else if (!mir_strcmpi(messageType.c_str(), "RichText/Files"))
+ else if (messageType == "RichText/UriObject")
{
- AddDbEvent(SKYPE_DB_EVENT_TYPE_FILETRANSFER_INFO, hContact, timestamp, DBEF_UTF, content.c_str(), clientMsgId.c_str());
+ AddDbEvent(SKYPE_DB_EVENT_TYPE_URIOBJ, hContact, timestamp, iFlags, content.c_str(), szMessageId);
}
- else if (!mir_strcmpi(messageType.c_str(), "RichText/UriObject"))
+ else
{
- AddDbEvent(SKYPE_DB_EVENT_TYPE_URIOBJ, hContact, timestamp, DBEF_UTF, content.c_str(), clientMsgId.c_str());
+ AddDbEvent(SKYPE_DB_EVENT_TYPE_UNKNOWN, hContact, timestamp, iFlags, content.c_str(), szMessageId);
}
}
else if (conversationLink.find("/19:") != -1)
|