diff options
Diffstat (limited to 'protocols/Slack/src/slack_utils.cpp')
-rw-r--r-- | protocols/Slack/src/slack_utils.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/protocols/Slack/src/slack_utils.cpp b/protocols/Slack/src/slack_utils.cpp new file mode 100644 index 0000000000..bd40f58ee7 --- /dev/null +++ b/protocols/Slack/src/slack_utils.cpp @@ -0,0 +1,45 @@ +#include "stdafx.h" + +bool CSlackProto::IsOnline() +{ + return false; +} + +void CSlackProto::ShowNotification(const TCHAR *caption, const TCHAR *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 CSlackProto::ShowNotification(const TCHAR *message, int flags, MCONTACT hContact) +{ + ShowNotification(_A2W(MODULE), message, flags, hContact); +} + +MEVENT CSlackProto::AddEventToDb(MCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, PBYTE pBlob, DWORD cbBlob) +{ + DBEVENTINFO dbei = {}; + dbei.szModule = this->m_szModuleName; + dbei.timestamp = timestamp; + dbei.eventType = type; + dbei.cbBlob = cbBlob; + dbei.pBlob = pBlob; + dbei.flags = flags; + return db_event_add(hContact, &dbei); +}
\ No newline at end of file |