From 63afce56f08e031e45a6a33f56af0f312c8bfc91 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sat, 16 Aug 2014 17:26:20 +0000 Subject: Tox: added tox icon git-svn-id: http://svn.miranda-ng.org/main/trunk@10204 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_utils.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'protocols/Tox/src/tox_utils.cpp') diff --git a/protocols/Tox/src/tox_utils.cpp b/protocols/Tox/src/tox_utils.cpp index 4fb527df27..9f47d67de1 100644 --- a/protocols/Tox/src/tox_utils.cpp +++ b/protocols/Tox/src/tox_utils.cpp @@ -33,6 +33,31 @@ int CToxProto::ToxToMirandaStatus(TOX_USERSTATUS userstatus) return status; } +void CToxProto::ShowNotification(const wchar_t *caption, const wchar_t *message, int flags, MCONTACT hContact) +{ + if (Miranda_Terminated()) + return; + + if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1)) + { + POPUPDATAW ppd = { 0 }; + ppd.lchContact = hContact; + wcsncpy(ppd.lpwzContactName, caption, MAX_CONTACTNAME); + wcsncpy(ppd.lpwzText, message, MAX_SECONDLINE); + ppd.lchIcon = Skin_GetIcon("Tox_main"); + + if (!PUAddPopupW(&ppd)) + return; + } + + MessageBoxW(NULL, message, caption, MB_OK | flags); +} + +void CToxProto::ShowNotification(const wchar_t *message, int flags, MCONTACT hContact) +{ + ShowNotification(TranslateT(MODULE), message, flags, hContact); +} + HANDLE CToxProto::AddDbEvent(MCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, DWORD cbBlob, PBYTE pBlob) { DBEVENTINFO dbei = { sizeof(dbei) }; -- cgit v1.2.3