diff options
author | aunsane <aunsane@gmail.com> | 2017-03-12 21:19:21 +0300 |
---|---|---|
committer | aunsane <aunsane@gmail.com> | 2017-03-12 21:19:38 +0300 |
commit | b9c2a6953f0fa75a1c4de6079e9c97b3a60be7e5 (patch) | |
tree | 83940e0306fd9b0eca9dfe7ce679b437cde9331b /protocols/Slack/src/slack_messages.cpp | |
parent | 9826bda7bcd2a2024eac0fcecffc9633f5ac79f6 (diff) |
Slack: initial commit
Diffstat (limited to 'protocols/Slack/src/slack_messages.cpp')
-rw-r--r-- | protocols/Slack/src/slack_messages.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/protocols/Slack/src/slack_messages.cpp b/protocols/Slack/src/slack_messages.cpp new file mode 100644 index 0000000000..f78ba3e9db --- /dev/null +++ b/protocols/Slack/src/slack_messages.cpp @@ -0,0 +1,49 @@ +#include "stdafx.h" + +/* MESSAGE RECEIVING */ + +// incoming message flow + + +// writing message/even into db +int CSlackProto::OnReceiveMessage(MCONTACT hContact, PROTORECVEVENT *pre) +{ + //return Proto_RecvMessage(hContact, pre); + if (pre->szMessage == NULL) + return NULL; + + DBEVENTINFO dbei = {}; + dbei.szModule = GetContactProto(hContact); + dbei.timestamp = pre->timestamp; + dbei.flags = 0; + dbei.eventType = pre->lParam; + dbei.cbBlob = (DWORD)mir_strlen(pre->szMessage) + 1; + dbei.pBlob = (PBYTE)pre->szMessage; + + return (INT_PTR)db_event_add(hContact, &dbei); +} + +/* MESSAGE SENDING */ + +// outcoming message flow +int CSlackProto::OnSendMessage(MCONTACT hContact, int flags, const char *szMessage) +{ + return 0; +} + +// message is received by the other side + +// preparing message/action to writing into db +int CSlackProto::OnPreCreateMessage(WPARAM, LPARAM lParam) +{ + MessageWindowEvent *evt = (MessageWindowEvent*)lParam; + if (mir_strcmp(GetContactProto(evt->hContact), m_szModuleName)) + return 0; +} + +/* TYPING */ + +int CSlackProto::OnUserIsTyping(MCONTACT hContact, int type) +{ + return 0; +}
\ No newline at end of file |