diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-05-06 13:22:54 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-05-06 13:22:54 +0000 |
commit | d1b31445c6f4a53627a025b43afb24603bc12dc2 (patch) | |
tree | 3f95d2e9a488e068b9ae4457bd806566ce50eb02 /protocols/SkypeWeb/src/skype_history_sync.cpp | |
parent | d44364a07a1213424fe0a6b14d948b43768137df (diff) |
SkypeWeb: Rework writing calls info to db. Sync fix.
git-svn-id: http://svn.miranda-ng.org/main/trunk@13460 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 | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/protocols/SkypeWeb/src/skype_history_sync.cpp b/protocols/SkypeWeb/src/skype_history_sync.cpp index 98afb8bb90..0e394049b3 100644 --- a/protocols/SkypeWeb/src/skype_history_sync.cpp +++ b/protocols/SkypeWeb/src/skype_history_sync.cpp @@ -39,11 +39,6 @@ void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response) if (totalCount >= 99 || json_size(conversations) >= 99)
PushRequest(new GetHistoryOnUrlRequest(syncState, RegToken), &CSkypeProto::OnGetServerHistory);
- int flags = DBEF_UTF;
-
- if (!markAllAsUnread)
- flags |= DBEF_READ;
-
for (int i = json_size(conversations); i >= 0; i--)
{
JSONNODE *message = json_at(conversations, i);
@@ -62,15 +57,20 @@ void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response) bool isEdited = (json_get(message, "skypeeditedid") != NULL);
MCONTACT hContact = FindContact(ptrA(ContactUrlToName(conversationLink)));
+
+ int flags = DBEF_UTF;
+
+ if (!markAllAsUnread)
+ flags |= DBEF_READ;
+
+ if (IsMe(skypename))
+ flags |= DBEF_SENT;
+
if (conversationLink != NULL && strstr(conversationLink, "/8:"))
{
if (!mir_strcmpi(messageType, "Text") || !mir_strcmpi(messageType, "RichText"))
{
- bool isMe = IsMe(skypename);
- if (isMe)
- flags |= DBEF_SENT;
-
ptrA message(RemoveHtml(content));
MEVENT dbevent = GetMessageFromDb(hContact, skypeEditedId);
@@ -147,7 +147,7 @@ void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response) csec.AppendFormat(sec < 10 ? "0%d" : "%d", sec);
text.AppendFormat("%s\n%s: %s:%s:%s", Translate("Call ended"), Translate("Duration"), chours, cmins, csec);
}
- AddMessageToDb(hContact, timestamp, flags, clientMsgId, text.GetBuffer());
+ AddCallInfoToDb(hContact, timestamp, flags, clientMsgId, text.GetBuffer());
}
else if (!mir_strcmpi(messageType, "RichText/Files"))
{
|