diff options
author | George Hazan <ghazan@miranda.im> | 2019-03-01 17:54:28 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-03-01 17:54:28 +0300 |
commit | 70b77d0c25f8138e30d78d3af7966711cff3b375 (patch) | |
tree | 2897257dd4a29e2daf2be303ace50efe5eeb8efe /protocols/SkypeWeb/src/skype_db.cpp | |
parent | a9047d304ccd9c25fa254417f39911c6e079339c (diff) |
fixes #1871 (SkypeWeb: after synchronization, edited message is deleted in Miranda NG, and not replaced with edited message)
Diffstat (limited to 'protocols/SkypeWeb/src/skype_db.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_db.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/protocols/SkypeWeb/src/skype_db.cpp b/protocols/SkypeWeb/src/skype_db.cpp index f26673d8ad..63e7b9aa32 100644 --- a/protocols/SkypeWeb/src/skype_db.cpp +++ b/protocols/SkypeWeb/src/skype_db.cpp @@ -49,7 +49,7 @@ MEVENT CSkypeProto::AddDbEvent(WORD type, MCONTACT hContact, DWORD timestamp, DW return ret; } -MEVENT CSkypeProto::AppendDBEvent(MCONTACT hContact, MEVENT hEvent, const char *szContent, const char *szUid, time_t edit_time) +void CSkypeProto::EditEvent(MCONTACT hContact, MEVENT hEvent, const char *szContent, time_t edit_time) { mir_cslock lck(m_AppendMessageLock); DBEVENTINFO dbei = {}; @@ -66,7 +66,7 @@ MEVENT CSkypeProto::AppendDBEvent(MCONTACT hContact, MEVENT hEvent, const char * const JSONNode &jEdit = *it; if (jEdit["time"].as_int() == edit_time) - return hEvent; + return; } JSONNode jEdit; jEdit @@ -96,8 +96,10 @@ MEVENT CSkypeProto::AppendDBEvent(MCONTACT hContact, MEVENT hEvent, const char * jMsg << jEdits; } - db_event_delete(hContact, hEvent); - return AddDbEvent(SKYPE_DB_EVENT_TYPE_EDITED_MESSAGE, hContact, dbei.timestamp, dbei.flags, jMsg.write().c_str(), szUid); + std::string newMsg = jMsg.write().c_str(); + dbei.cbBlob = newMsg.size() + 1; + dbei.pBlob = (PBYTE)newMsg.c_str(); + db_event_edit(hContact, hEvent, &dbei); } MEVENT CSkypeProto::AddEventToDb(MCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, DWORD cbBlob, PBYTE pBlob) |