diff options
Diffstat (limited to 'protocols/Tox/src/tox_utils.cpp')
-rw-r--r-- | protocols/Tox/src/tox_utils.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
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) };
|