summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-04-15 15:11:40 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-04-15 15:11:40 +0000
commit2e3b0d5d40f1113887bd67e6ba227b780c4293cd (patch)
treec499265d20349eee185f1cf499a07c84f797352c
parentb3e7101449926ca88ae21a5b435da7a2fd884320 (diff)
SkypeWeb: Edited messages support part 2.
git-svn-id: http://svn.miranda-ng.org/main/trunk@12839 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/SkypeWeb/src/skype_history_sync.cpp14
-rw-r--r--protocols/SkypeWeb/src/skype_messages.cpp10
2 files changed, 12 insertions, 12 deletions
diff --git a/protocols/SkypeWeb/src/skype_history_sync.cpp b/protocols/SkypeWeb/src/skype_history_sync.cpp
index 3f781d236e..58d3b5a014 100644
--- a/protocols/SkypeWeb/src/skype_history_sync.cpp
+++ b/protocols/SkypeWeb/src/skype_history_sync.cpp
@@ -62,13 +62,13 @@ void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response)
if (isEdited && dbevent != NULL)
{
DBEVENTINFO dbei = { sizeof(dbei) };
+ CMStringA msg;
db_event_get(dbevent, &dbei);
time_t dbEventTimestamp = dbei.timestamp;
- if (!getByte("SaveEditedMessage", 0))
- {
- db_event_delete(hContact, dbevent);
- }
- AddMessageToDb(hContact, dbEventTimestamp + 1, flags, clientMsgId, message, emoteOffset);
+ ptrA dbMsgText((char *)mir_alloc(dbei.cbBlob));
+ msg.AppendFormat("%s\n%s [%s]:\n%s", dbMsgText, Translate("Edited at"), ptrA(mir_t2a(composeTime)), message);
+ db_event_delete(hContact, dbevent);
+ AddMessageToDb(hContact, dbEventTimestamp, flags, clientMsgId, msg.GetBuffer(), emoteOffset);
}
else
AddMessageToDb(hContact, timestamp, flags, clientMsgId, message, emoteOffset);
@@ -76,7 +76,7 @@ void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response)
}
}
-INT_PTR CSkypeProto::GetContactHistory(WPARAM hContact, LPARAM lParam)
+INT_PTR CSkypeProto::GetContactHistory(WPARAM hContact, LPARAM)
{
PushRequest(new GetHistoryRequest(ptrA(getStringA("registrationToken")), ptrA(db_get_sa(hContact, m_szModuleName, SKYPE_SETTINGS_ID)), 0, ptrA(getStringA("Server"))), &CSkypeProto::OnGetServerHistory);
return 0;
@@ -114,7 +114,7 @@ void CSkypeProto::OnSyncHistory(const NETLIBHTTPREQUEST *response)
MCONTACT hContact = FindContact(skypename);
if (hContact == NULL && !IsMe(skypename))
hContact = AddContact(skypename, true);
- if (GetMessageFromDb(hContact, clientMsgId, composeTime) == NULL && !isEdited)
+ if (GetMessageFromDb(hContact, clientMsgId, composeTime) == NULL)
PushRequest(new GetHistoryRequest(ptrA(getStringA("registrationToken")), skypename, ptrA(getStringA("Server"))), &CSkypeProto::OnGetServerHistory);
}
} \ No newline at end of file
diff --git a/protocols/SkypeWeb/src/skype_messages.cpp b/protocols/SkypeWeb/src/skype_messages.cpp
index c313dec4d5..2994ef3967 100644
--- a/protocols/SkypeWeb/src/skype_messages.cpp
+++ b/protocols/SkypeWeb/src/skype_messages.cpp
@@ -243,13 +243,13 @@ void CSkypeProto::OnPrivateMessageEvent(JSONNODE *node)
if (isEdited && dbevent != NULL)
{
DBEVENTINFO dbei = { sizeof(dbei) };
+ CMStringA msg;
db_event_get(dbevent, &dbei);
time_t dbEventTimestamp = dbei.timestamp;
- if (!getByte("SaveEditedMessage", 0))
- {
- db_event_delete(hContact, dbevent);
- }
- OnReceiveMessage(clientMsgId, from, dbEventTimestamp + 1, message, emoteOffset);
+ ptrA dbMsgText((char *)mir_alloc(dbei.cbBlob));
+ msg.AppendFormat("%s\n%s [%s]:\n%s", dbMsgText, Translate("Edited at"), ptrA(mir_t2a(composeTime)), message);
+ db_event_delete(hContact, dbevent);
+ OnReceiveMessage(clientMsgId, from, dbEventTimestamp, msg.GetBuffer(), emoteOffset);
}
else
OnReceiveMessage(clientMsgId, from, timestamp, message, emoteOffset);