summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_messages.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-05-24 17:33:28 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-05-24 17:33:28 +0300
commitd782eaf66c6e77e44393e89c7d8df4416adafb9e (patch)
treee095a21674884a83c83276cd11d9fda0187efd66 /protocols/SkypeWeb/src/skype_messages.cpp
parenta66dc37bc321e89ff881ba0ccbe2a4ae3fa2720e (diff)
SkypeWeb: patch to save history in the correct order
Diffstat (limited to 'protocols/SkypeWeb/src/skype_messages.cpp')
-rw-r--r--protocols/SkypeWeb/src/skype_messages.cpp28
1 files changed, 9 insertions, 19 deletions
diff --git a/protocols/SkypeWeb/src/skype_messages.cpp b/protocols/SkypeWeb/src/skype_messages.cpp
index 17021d1030..80f054b2f8 100644
--- a/protocols/SkypeWeb/src/skype_messages.cpp
+++ b/protocols/SkypeWeb/src/skype_messages.cpp
@@ -17,22 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
-/* MESSAGE RECEIVING */
-
-// incoming message flow
-int CSkypeProto::OnReceiveMessage(MCONTACT hContact, const char *szContent, const char *szMessageId, time_t timestamp, int emoteOffset, bool isRead)
-{
- PROTORECVEVENT recv = {};
- recv.timestamp = timestamp;
- recv.szMessage = mir_strdup(szContent);
- recv.lParam = emoteOffset;
- recv.szMsgId = szMessageId;
- if (isRead)
- recv.flags |= PREF_CREATEREAD;
-
- return ProtoChainRecvMsg(hContact, &recv);
-}
-
/* MESSAGE SENDING */
struct SendMessageParam
@@ -121,7 +105,7 @@ void CSkypeProto::OnPrivateMessageEvent(const JSONNode &node)
ptrA szClearedContent(strMessageType == "RichText" ? RemoveHtml(strContent.c_str()) : mir_strdup(strContent.c_str()));
bool bEdited = node["skypeeditedid"];
- time_t timestamp = IsoToUnixTime(node["composetime"].as_string().c_str());
+ time_t timestamp = time(0); // fuck the server time, we need to place events in the order of our local time
int nEmoteOffset = atoi(node["skypeemoteoffset"].as_string().c_str());
@@ -157,8 +141,14 @@ void CSkypeProto::OnPrivateMessageEvent(const JSONNode &node)
MEVENT hDbEvent = GetMessageFromDb(szMessageId);
if (bEdited && hDbEvent != NULL)
EditEvent(hContact, hDbEvent, szClearedContent, timestamp);
- else
- OnReceiveMessage(hContact, szClearedContent, szMessageId, timestamp, nEmoteOffset);
+ else {
+ PROTORECVEVENT recv = {};
+ recv.timestamp = timestamp;
+ recv.szMessage = mir_strdup(szClearedContent);
+ recv.lParam = nEmoteOffset;
+ recv.szMsgId = szMessageId;
+ ProtoChainRecvMsg(hContact, &recv);
+ }
}
}
else if (strMessageType == "Event/Call") {