diff options
author | George Hazan <ghazan@miranda.im> | 2020-12-20 16:52:04 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-12-20 16:52:04 +0300 |
commit | e8f02156813b7153d4970fd83f2e6adac3517923 (patch) | |
tree | 49632cf70e8dc0f6b464a0bbc6e06e0c88c2ca90 /protocols/SkypeWeb/src/skype_db.cpp | |
parent | ab6c868bccb088d493ab4016fd1918d822adfc2b (diff) |
SkypeWeb: protocol reworked almost from scratch to support contact types other than 8 & 19
Diffstat (limited to 'protocols/SkypeWeb/src/skype_db.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_db.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/protocols/SkypeWeb/src/skype_db.cpp b/protocols/SkypeWeb/src/skype_db.cpp index dc102efb8f..d90d255231 100644 --- a/protocols/SkypeWeb/src/skype_db.cpp +++ b/protocols/SkypeWeb/src/skype_db.cpp @@ -38,23 +38,24 @@ MEVENT CSkypeProto::GetMessageFromDb(const char *messageId) return db_event_getById(m_szModuleName, messageId); } -MEVENT CSkypeProto::AddDbEvent(WORD type, MCONTACT hContact, DWORD timestamp, DWORD flags, const char *content, const char *uid) +MEVENT CSkypeProto::AddDbEvent(WORD type, MCONTACT hContact, DWORD timestamp, DWORD flags, const CMStringW &content, const CMStringA &msgId) { - if (MEVENT hDbEvent = GetMessageFromDb(uid)) + if (MEVENT hDbEvent = GetMessageFromDb(msgId)) return hDbEvent; + T2Utf szMsg(content); DBEVENTINFO dbei = {}; dbei.szModule = m_szModuleName; dbei.timestamp = timestamp; dbei.eventType = type; - dbei.cbBlob = (DWORD)mir_strlen(content) + 1; - dbei.pBlob = (BYTE *)content; + dbei.cbBlob = (DWORD)mir_strlen(szMsg) + 1; + dbei.pBlob = (BYTE *)szMsg; dbei.flags = flags; - dbei.szId = uid; + dbei.szId = msgId; return db_event_add(hContact, &dbei); } -void CSkypeProto::EditEvent(MCONTACT hContact, MEVENT hEvent, const char *szContent, time_t edit_time) +void CSkypeProto::EditEvent(MCONTACT hContact, MEVENT hEvent, const CMStringW &szContent, time_t edit_time) { mir_cslock lck(m_AppendMessageLock); DBEVENTINFO dbei = {}; @@ -72,7 +73,7 @@ void CSkypeProto::EditEvent(MCONTACT hContact, MEVENT hEvent, const char *szCont return; JSONNode jEdit; - jEdit << INT_PARAM("time", (long)edit_time) << CHAR_PARAM("text", szContent); + jEdit << INT_PARAM("time", (long)edit_time) << WCHAR_PARAM("text", szContent); jEdits << jEdit; } } @@ -84,7 +85,7 @@ void CSkypeProto::EditEvent(MCONTACT hContact, MEVENT hEvent, const char *szCont jMsg << jOriginalMsg; JSONNode jEdit; - jEdit << INT_PARAM("time", (long)edit_time) << CHAR_PARAM("text", szContent); + jEdit << INT_PARAM("time", (long)edit_time) << WCHAR_PARAM("text", szContent); JSONNode jEdits(JSON_ARRAY); jEdits.set_name("edits"); jEdits << jEdit; |