From babe62f61852bb292c4eef1e64c316f21b789ef6 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sat, 25 Apr 2015 18:43:32 +0000 Subject: SkypeWeb: "/me" in chats. git-svn-id: http://svn.miranda-ng.org/main/trunk@13144 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_history_sync.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 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 d0a119d5da..8621cce056 100644 --- a/protocols/SkypeWeb/src/skype_history_sync.cpp +++ b/protocols/SkypeWeb/src/skype_history_sync.cpp @@ -49,18 +49,16 @@ void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response) ptrA content(mir_t2a(ptrT(json_as_string(json_get(message, "content"))))); ptrT composeTime(json_as_string(json_get(message, "composetime"))); ptrA conversationLink(mir_t2a(ptrT(json_as_string(json_get(message, "conversationLink"))))); + int emoteOffset = atoi(ptrA(mir_t2a(ptrT(json_as_string(json_get(message, "skypeemoteoffset")))))); time_t timestamp = IsoToUnixTime(composeTime); + ptrA skypename(ContactUrlToName(from)); bool isEdited = (json_get(message, "skypeeditedid") != NULL); if (conversationLink != NULL && strstr(conversationLink, "/8:")) { if (!mir_strcmpi(messageType, "Text") || !mir_strcmpi(messageType, "RichText")) { - int emoteOffset = json_as_int(json_get(message, "skypeemoteoffset")); - int flags = DBEF_UTF | DBEF_READ; - ptrA skypename(ContactUrlToName(from)); - bool isMe = IsMe(skypename); if (isMe) flags |= DBEF_SENT; @@ -149,15 +147,7 @@ void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response) ptrA chatname(ChatUrlToName(conversationLink)); if (!mir_strcmpi(messageType, "Text") || !mir_strcmpi(messageType, "RichText")) { - GCDEST gcd = { m_szModuleName, _A2T(chatname), GC_EVENT_MESSAGE }; - GCEVENT gce = { sizeof(GCEVENT), &gcd }; - gce.bIsMe = IsMe(ContactUrlToName(from)); - gce.ptszUID = mir_a2t(ContactUrlToName(from)); - gce.time = timestamp; - gce.ptszNick = mir_a2t(ContactUrlToName(from)); - gce.ptszText = mir_a2t(RemoveHtml(content)); - gce.dwFlags = GCEF_NOTNOTIFY; - CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce); + AddMessageToChat(_A2T(chatname), _A2T(skypename), content, emoteOffset != NULL, emoteOffset, timestamp, true); } } } -- cgit v1.2.3