From d179fcc04d6999c9ef44ac4dc312f0ca685192df Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Mon, 20 Apr 2015 07:11:08 +0000 Subject: SkypeWeb: Messaging fixes. git-svn-id: http://svn.miranda-ng.org/main/trunk@12953 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_history_sync.cpp | 53 ++++++++++++++------------- 1 file changed, 28 insertions(+), 25 deletions(-) (limited to 'protocols/SkypeWeb/src/skype_history_sync.cpp') diff --git a/protocols/SkypeWeb/src/skype_history_sync.cpp b/protocols/SkypeWeb/src/skype_history_sync.cpp index d633dfe8a3..2322ecb930 100644 --- a/protocols/SkypeWeb/src/skype_history_sync.cpp +++ b/protocols/SkypeWeb/src/skype_history_sync.cpp @@ -53,42 +53,45 @@ void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response) bool isEdited = (json_get(message, "skypeeditedid") != NULL); if (conversationLink != NULL && strstr(conversationLink, "/8:")) { - int emoteOffset = json_as_int(json_get(message, "skypeemoteoffset")); + if (!mir_strcmpi(messageType, "Text") || !mir_strcmpi(messageType, "RichText")) + { + int emoteOffset = json_as_int(json_get(message, "skypeemoteoffset")); - int flags = DBEF_UTF | DBEF_READ; + int flags = DBEF_UTF | DBEF_READ; - ptrA skypename(ContactUrlToName(from)); + ptrA skypename(ContactUrlToName(from)); - bool isMe = IsMe(skypename); - if (isMe) - flags |= DBEF_SENT; + bool isMe = IsMe(skypename); + if (isMe) + flags |= DBEF_SENT; - MCONTACT hContact = FindContact(ptrA(ContactUrlToName(conversationLink))); + MCONTACT hContact = FindContact(ptrA(ContactUrlToName(conversationLink))); - ptrA message(RemoveHtml(content)); - MEVENT dbevent = GetMessageFromDb(hContact, skypeEditedId); + ptrA message(RemoveHtml(content)); + MEVENT dbevent = GetMessageFromDb(hContact, skypeEditedId); - if (isEdited && dbevent != NULL) - { - DBEVENTINFO dbei = { sizeof(dbei) }; - CMStringA msg; + if (isEdited && dbevent != NULL) + { + DBEVENTINFO dbei = { sizeof(dbei) }; + CMStringA msg; - dbei.cbBlob = db_event_getBlobSize(dbevent); - mir_ptr blob((PBYTE)mir_alloc(dbei.cbBlob)); - dbei.pBlob = blob; + dbei.cbBlob = db_event_getBlobSize(dbevent); + mir_ptr blob((PBYTE)mir_alloc(dbei.cbBlob)); + dbei.pBlob = blob; - db_event_get(dbevent, &dbei); - time_t dbEventTimestamp = dbei.timestamp; - ptrA dbMsgText((char *)mir_alloc(dbei.cbBlob)); + db_event_get(dbevent, &dbei); + time_t dbEventTimestamp = dbei.timestamp; + ptrA dbMsgText((char *)mir_alloc(dbei.cbBlob)); - mir_strcpy(dbMsgText, (char*)dbei.pBlob); + mir_strcpy(dbMsgText, (char*)dbei.pBlob); - 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); + 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); } - else - AddMessageToDb(hContact, timestamp, flags, clientMsgId, message, emoteOffset); } else if (conversationLink != NULL && strstr(conversationLink, "/19:")) { -- cgit v1.2.3