From ea1c72e6742777aae4f7cb2602006c0ef8cce1ed Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Fri, 1 May 2015 18:24:18 +0000 Subject: SkypeWeb: Small fixes. git-svn-id: http://svn.miranda-ng.org/main/trunk@13343 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_contacts.cpp | 9 +++++++++ protocols/SkypeWeb/src/skype_history_sync.cpp | 3 ++- protocols/SkypeWeb/src/skype_poll_processing.cpp | 4 ++-- protocols/SkypeWeb/src/skype_trouter.cpp | 10 ++++------ 4 files changed, 17 insertions(+), 9 deletions(-) (limited to 'protocols') diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index 0e00c5753b..dee3f7adc6 100644 --- a/protocols/SkypeWeb/src/skype_contacts.cpp +++ b/protocols/SkypeWeb/src/skype_contacts.cpp @@ -227,6 +227,15 @@ void CSkypeProto::LoadContactList(const NETLIBHTTPREQUEST *response) db_set_b(hContact, "CList", "Hidden", 1); setByte(hContact, "IsBlocked", 1); } + else + { + if (db_get_b(hContact, m_szModuleName, "IsBlocked", 0)) + { + db_set_dw(hContact, "Ignore", "Mask1", 0); + db_set_b(hContact, "CList", "Hidden", 0); + setByte(hContact, "IsBlocked", 0); + } + } skypenames.insert(mir_strdup(skypename)); } diff --git a/protocols/SkypeWeb/src/skype_history_sync.cpp b/protocols/SkypeWeb/src/skype_history_sync.cpp index ce6a672766..98b10b9a38 100644 --- a/protocols/SkypeWeb/src/skype_history_sync.cpp +++ b/protocols/SkypeWeb/src/skype_history_sync.cpp @@ -52,7 +52,9 @@ void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response) 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); + MCONTACT hContact = FindContact(ptrA(ContactUrlToName(conversationLink))); if (conversationLink != NULL && strstr(conversationLink, "/8:")) { @@ -218,7 +220,6 @@ void CSkypeProto::OnSyncHistory(const NETLIBHTTPREQUEST *response) char *clientMsgId = mir_t2a(json_as_string(json_get(lastMessage, "clientmessageid"))); char *skypeEditedId = mir_t2a(json_as_string(json_get(lastMessage, "skypeeditedid"))); - bool isEdited = (skypeEditedId != NULL); char *conversationLink = mir_t2a(json_as_string(json_get(lastMessage, "conversationLink"))); time_t composeTime(IsoToUnixTime(ptrT(json_as_string(json_get(lastMessage, "composetime"))))); diff --git a/protocols/SkypeWeb/src/skype_poll_processing.cpp b/protocols/SkypeWeb/src/skype_poll_processing.cpp index 488bf66668..e6a46d531c 100644 --- a/protocols/SkypeWeb/src/skype_poll_processing.cpp +++ b/protocols/SkypeWeb/src/skype_poll_processing.cpp @@ -24,7 +24,7 @@ void CSkypeProto::ProcessEndpointPresenceRes(JSONNODE *node) ptrA skypename(ContactUrlToName(selfLink)); if (skypename == NULL) return; - MCONTACT hContact = FindContact(skypename); + MCONTACT hContact = AddContact(skypename, true); //"publicInfo":{"capabilities":"","typ":"11","skypeNameVersion":"0/7.1.0.105//","nodeInfo":"","version":"24"} JSONNODE *publicInfo = json_get(node, "publicInfo"); @@ -104,7 +104,7 @@ void CSkypeProto::ProcessUserPresenceRes(JSONNODE *node) } return; } - MCONTACT hContact = FindContact(skypename); + MCONTACT hContact = AddContact(skypename, true); SetContactStatus(hContact, SkypeToMirandaStatus(status)); } diff --git a/protocols/SkypeWeb/src/skype_trouter.cpp b/protocols/SkypeWeb/src/skype_trouter.cpp index c89e184fad..3f76c3e731 100644 --- a/protocols/SkypeWeb/src/skype_trouter.cpp +++ b/protocols/SkypeWeb/src/skype_trouter.cpp @@ -92,6 +92,7 @@ void CSkypeProto::OnHealth(const NETLIBHTTPREQUEST*) void CSkypeProto::OnTrouterEvent(JSONNODE *body, JSONNODE *headers) { ptrT displayname(json_as_string(json_get(body, "displayName"))); + ptrT cuid(json_as_string(json_get(body, "callerId"))); ptrT uid(json_as_string(json_get(body, "conversationId"))); ptrA callId(mir_t2a(ptrT(json_as_string(json_get(body, "callId"))))); int evt = json_as_int(json_get(body, "evt")); @@ -126,7 +127,7 @@ void CSkypeProto::OnTrouterEvent(JSONNODE *body, JSONNODE *headers) } break; } - case 104: //call canceled + case 104: //call canceled: callerId=""; conversationId=NULL; callId=call id { break; } @@ -185,11 +186,6 @@ void CSkypeProto::TRouterThread(void*) CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)response); delete request; } - - if (!isTerminated) - { - debugLogA(__FUNCTION__": unexpected termination; switching protocol to offline"); - } m_hTrouterThread = NULL; m_TrouterConnection = NULL; debugLogA(__FUNCTION__": leaving"); @@ -213,7 +209,9 @@ INT_PTR CSkypeProto::OnIncomingCallPP(WPARAM wParam, LPARAM hContact) break; } } + if (wParam == 1) NotifyEventHooks(m_hCallHook, (WPARAM)hContact, (LPARAM)0); + return 0; } \ No newline at end of file -- cgit v1.2.3