diff options
author | aunsane <aunsane@gmail.com> | 2017-04-16 01:32:19 +0300 |
---|---|---|
committer | aunsane <aunsane@gmail.com> | 2017-04-16 01:32:58 +0300 |
commit | 0b9fa1d90f8d0aff7118837ceb1211b578a5a9c8 (patch) | |
tree | 3b8be7b839a98a3a52a38d713c2d708ada015510 /plugins/CloudFile/src/utils.cpp | |
parent | 008fb731e3e3b587f596afba1cfe7446de7f0cac (diff) |
CloudFile: initial commit
- Dropbox (worked)
- Yandex.Disk (worked)
- GDrive (not worked)
Diffstat (limited to 'plugins/CloudFile/src/utils.cpp')
-rw-r--r-- | plugins/CloudFile/src/utils.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/plugins/CloudFile/src/utils.cpp b/plugins/CloudFile/src/utils.cpp new file mode 100644 index 0000000000..cabcd7de97 --- /dev/null +++ b/plugins/CloudFile/src/utils.cpp @@ -0,0 +1,40 @@ +#include "stdafx.h" + +void ShowNotification(const wchar_t *caption, const wchar_t *message, int flags, MCONTACT hContact) +{ + if (Miranda_IsTerminated()) + { + return; + } + + if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1)) + { + POPUPDATAT ppd = { 0 }; + ppd.lchContact = hContact; + wcsncpy(ppd.lpwzContactName, caption, MAX_CONTACTNAME); + wcsncpy(ppd.lpwzText, message, MAX_SECONDLINE); + ppd.lchIcon = IcoLib_GetIcon("Slack_main"); + + if (!PUAddPopupT(&ppd)) + return; + } + + MessageBox(NULL, message, caption, MB_OK | flags); +} + +void ShowNotification(const wchar_t *message, int flags, MCONTACT hContact) +{ + ShowNotification(_A2W(MODULE), message, flags, hContact); +} + +MEVENT AddEventToDb(MCONTACT hContact, WORD type, DWORD flags, DWORD cbBlob, PBYTE pBlob) +{ + DBEVENTINFO dbei = {}; + dbei.szModule = MODULE; + dbei.timestamp = time(NULL); + dbei.eventType = type; + dbei.cbBlob = cbBlob; + dbei.pBlob = pBlob; + dbei.flags = flags; + return db_event_add(hContact, &dbei); +} |