From 6a16d16bcc07a7f857c9d051982db2f7aa035e37 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sun, 3 May 2015 11:08:15 +0000 Subject: SkypeWeb: Notification on contacts & chats offline arfer logout removed. git-svn-id: http://svn.miranda-ng.org/main/trunk@13394 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_contacts.cpp | 17 ++++++++++++++++- protocols/SkypeWeb/src/skype_proto.cpp | 6 ++++-- protocols/SkypeWeb/src/skype_proto.h | 1 + 3 files changed, 21 insertions(+), 3 deletions(-) (limited to 'protocols/SkypeWeb') diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index dee3f7adc6..a8ed6868a0 100644 --- a/protocols/SkypeWeb/src/skype_contacts.cpp +++ b/protocols/SkypeWeb/src/skype_contacts.cpp @@ -36,7 +36,22 @@ void CSkypeProto::SetContactStatus(MCONTACT hContact, WORD status) void CSkypeProto::SetAllContactsStatus(WORD status) { for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) - SetContactStatus(hContact, status); + { + if (!isChatRoom(hContact)) + SetContactStatus(hContact, status); + else + SetContactStatus(hContact, status); + } +} + +void CSkypeProto::SetChatStatus(MCONTACT hContact, int iStatus) +{ + ptrT tszChatID(getTStringA(hContact, "ChatRoomID")); + if (tszChatID == NULL) + return; + GCDEST gcd = { m_szModuleName, tszChatID, GC_EVENT_CONTROL }; + GCEVENT gce = { sizeof(gce), &gcd }; + CallServiceSync(MS_GC_EVENT, (iStatus == ID_STATUS_OFFLINE) ? SESSION_OFFLINE : SESSION_ONLINE, (LPARAM)&gce); } MCONTACT CSkypeProto::GetContactFromAuthEvent(MEVENT hEvent) diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp index 70124ca692..9c7acf6922 100644 --- a/protocols/SkypeWeb/src/skype_proto.cpp +++ b/protocols/SkypeWeb/src/skype_proto.cpp @@ -221,10 +221,12 @@ int CSkypeProto::SetStatus(int iNewStatus) } requestQueue->Stop(); + ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)m_iStatus, ID_STATUS_OFFLINE); + m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE; + if (!Miranda_Terminated()) SetAllContactsStatus(ID_STATUS_OFFLINE); - - m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE; + return 0; } else { diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h index cc9668083d..1c68f1a1b6 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -258,6 +258,7 @@ private: static void ResetOptions(HWND hwndDlg); static void FilterContacts(HWND hwndDlg, CSkypeProto *ppro); + void SetChatStatus(MCONTACT hContact, int iStatus); //polling void __cdecl PollingThread (void*); -- cgit v1.2.3