summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_messages.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-07-23 18:56:46 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-07-23 18:56:46 +0000
commit220a737d71fa88f3acc19bdd9da6fff828aa0fdb (patch)
tree286f0fc3854e019d56757b09000d36a1e15d2198 /protocols/SkypeWeb/src/skype_messages.cpp
parent586f0ebc1782548d7e620e1fb837540cfde1a6fb (diff)
SkypeWeb: Receiving edited messages refactoring
git-svn-id: http://svn.miranda-ng.org/main/trunk@14657 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_messages.cpp')
-rw-r--r--protocols/SkypeWeb/src/skype_messages.cpp20
1 files changed, 1 insertions, 19 deletions
diff --git a/protocols/SkypeWeb/src/skype_messages.cpp b/protocols/SkypeWeb/src/skype_messages.cpp
index ebc31f2ab0..8c8cbb25aa 100644
--- a/protocols/SkypeWeb/src/skype_messages.cpp
+++ b/protocols/SkypeWeb/src/skype_messages.cpp
@@ -180,25 +180,7 @@ void CSkypeProto::OnPrivateMessageEvent(const JSONNode &node)
MEVENT dbevent = GetMessageFromDb(hContact, skypeEditedId.c_str());
if (isEdited && dbevent != NULL)
{
- DBEVENTINFO dbei = { sizeof(dbei) };
- CMStringA msg;
- dbei.cbBlob = db_event_getBlobSize(dbevent);
- dbei.pBlob = mir_ptr<BYTE>((PBYTE)mir_alloc(dbei.cbBlob));
-
- db_event_get(dbevent, &dbei);
-
- time_t dbEventTimestamp = dbei.timestamp;
-
- char *dbMsgText = NEWSTR_ALLOCA((char *)dbei.pBlob);
-
- TCHAR time[64];
- _locale_t locale = _create_locale(LC_ALL, "");
- _tcsftime_l(time, sizeof(time), L"%X %x", localtime(&timestamp), locale);
- _free_locale(locale);
-
- msg.AppendFormat("%s\n%s %s:\n%s", mir_utf8decodeA(dbMsgText), Translate("Edited at"), T2Utf(time), mir_utf8decodeA(message));
- db_event_delete(hContact, dbevent);
- AddDbEvent(EVENTTYPE_MESSAGE, hContact, dbEventTimestamp, DBEF_UTF, ptrA(mir_utf8encode(msg.GetBuffer())), skypeEditedId.c_str());
+ AppendDBEvent(hContact, dbevent, message, skypeEditedId.c_str(), timestamp);
}
else OnReceiveMessage(clientMsgId.c_str(), conversationLink.c_str(), timestamp, message, emoteOffset);
}