From a99d97e92e9263dc53c072fdd39925ef513d1315 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sat, 20 Oct 2012 19:30:51 +0000 Subject: - added simple notification func git-svn-id: http://svn.miranda-ng.org/main/trunk@2003 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/skype.h | 2 +- protocols/Skype/src/skype_contacts.cpp | 2 +- protocols/Skype/src/skype_proto.h | 2 ++ protocols/Skype/src/skype_utils.cpp | 22 ++++++++++++++++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) (limited to 'protocols') diff --git a/protocols/Skype/src/skype.h b/protocols/Skype/src/skype.h index fd398a053f..0c23053a16 100644 --- a/protocols/Skype/src/skype.h +++ b/protocols/Skype/src/skype.h @@ -24,7 +24,7 @@ //#include #include #include -//#include +#include #include #include #include diff --git a/protocols/Skype/src/skype_contacts.cpp b/protocols/Skype/src/skype_contacts.cpp index 086c197c2c..589ad9fcf0 100644 --- a/protocols/Skype/src/skype_contacts.cpp +++ b/protocols/Skype/src/skype_contacts.cpp @@ -715,7 +715,7 @@ void __cdecl CSkypeProto::SearchContactBySidAsync(void* arg) HANDLE hContact = this->GetContactBySid(sid); if (hContact) { - //ShowPopup(is, _T("Contact already in your contact list"), ALLOW_MSGBOX, NULL); + this->ShowNotification(sid, _T("Contact already in your contact list"), 0); this->SendBroadcast(ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)sid, 0); return; } diff --git a/protocols/Skype/src/skype_proto.h b/protocols/Skype/src/skype_proto.h index 669ec40b09..a7c488d8d9 100644 --- a/protocols/Skype/src/skype_proto.h +++ b/protocols/Skype/src/skype_proto.h @@ -162,6 +162,8 @@ protected: int SkypeToMirandaLoginError(CAccount::LOGOUTREASON logoutReason); + void ShowNotification(const wchar_t *sid, const wchar_t *message, int flags = 0); + // instances static LIST instanceList; static int CompareProtos(const CSkypeProto *p1, const CSkypeProto *p2); diff --git a/protocols/Skype/src/skype_utils.cpp b/protocols/Skype/src/skype_utils.cpp index 99463853c3..f24f347965 100644 --- a/protocols/Skype/src/skype_utils.cpp +++ b/protocols/Skype/src/skype_utils.cpp @@ -155,4 +155,26 @@ int CSkypeProto::SkypeToMirandaLoginError(CAccount::LOGOUTREASON logoutReason) } return loginError; +} + +void CSkypeProto::ShowNotification(const wchar_t *sid, const wchar_t *message, int flags) +{ + if (::Miranda_Terminated()) return; + + if (!::ServiceExists(MS_POPUP_ADDPOPUPCLASS)) + { + MessageBoxW( + NULL, + message, + TranslateT("Skype Protocol"), + MB_OK); + } + else + { + POPUPDATACLASS ppd = { sizeof(ppd) }; + ppd.ptszTitle = sid; + ppd.ptszText = message; + + ::CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&ppd); + } } \ No newline at end of file -- cgit v1.2.3