diff options
author | George Hazan <ghazan@miranda.im> | 2016-12-27 20:40:35 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2016-12-27 20:40:35 +0300 |
commit | 3c0c4ec799f35eb99215758f99491583033c5741 (patch) | |
tree | 465e516f7dc5aa6ba7b8f952601b44c967c68d14 /protocols/Discord/src/proto.cpp | |
parent | e191ad15875a046f7a243596fe92e99f88cea072 (diff) |
first version of options dialog
Diffstat (limited to 'protocols/Discord/src/proto.cpp')
-rw-r--r-- | protocols/Discord/src/proto.cpp | 65 |
1 files changed, 56 insertions, 9 deletions
diff --git a/protocols/Discord/src/proto.cpp b/protocols/Discord/src/proto.cpp index 73651f7b7f..c0af3fe2bd 100644 --- a/protocols/Discord/src/proto.cpp +++ b/protocols/Discord/src/proto.cpp @@ -1,6 +1,5 @@ /* -Copyright © 2012-16 Miranda NG team -Copyright © 2009 Jim Porter +Copyright © 2016 Miranda NG team This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,24 +17,72 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdafx.h" -DiscordProto::DiscordProto(const char *proto_name, const wchar_t *username) : - PROTO<DiscordProto>(proto_name, username) +ÑDiscordProto::ÑDiscordProto(const char *proto_name, const wchar_t *username) : + PROTO<ÑDiscordProto>(proto_name, username) { - CreateProtoService(PS_GETNAME, &DiscordProto::GetName); - CreateProtoService(PS_GETSTATUS, &DiscordProto::GetStatus); + // Services + CreateProtoService(PS_GETNAME, &ÑDiscordProto::GetName); + CreateProtoService(PS_GETSTATUS, &ÑDiscordProto::GetStatus); + + // Events + HookProtoEvent(ME_OPT_INITIALISE, &ÑDiscordProto::OnOptionsInit); } -DiscordProto::~DiscordProto() +ÑDiscordProto::~ÑDiscordProto() { } -INT_PTR DiscordProto::GetName(WPARAM wParam, LPARAM lParam) +DWORD_PTR ÑDiscordProto::GetCaps(int type, MCONTACT) +{ + switch (type) { + case PFLAGNUM_1: + return PF1_IM | PF1_MODEMSGRECV | PF1_SERVERCLIST; + case PFLAGNUM_2: + return PF2_ONLINE; + case PFLAGNUM_3: + return PF2_ONLINE; + case PFLAGNUM_4: + return PF4_NOCUSTOMAUTH | PF4_AVATARS; + case PFLAG_UNIQUEIDTEXT: + return (DWORD_PTR)"E-mail"; + case PFLAG_UNIQUEIDSETTING: + return (DWORD_PTR)DB_KEY_EMAIL; + } + return 0; +} + +INT_PTR ÑDiscordProto::GetName(WPARAM wParam, LPARAM lParam) { mir_strncpy((char*)lParam, m_szModuleName, (int)wParam); return 0; } -INT_PTR DiscordProto::GetStatus(WPARAM, LPARAM) +INT_PTR ÑDiscordProto::GetStatus(WPARAM, LPARAM) { return m_iStatus; } + +///////////////////////////////////////////////////////////////////////////////////////// + +int ÑDiscordProto::OnModulesLoaded(WPARAM, LPARAM) +{ + return 0; +} + +int ÑDiscordProto::OnPreShutdown(WPARAM, LPARAM) +{ + return 0; +} + +///////////////////////////////////////////////////////////////////////////////////////// + +int ÑDiscordProto::OnEvent(PROTOEVENTTYPE event, WPARAM wParam, LPARAM lParam) +{ + switch (event) { + case EV_PROTO_ONLOAD: return OnModulesLoaded(wParam, lParam); + case EV_PROTO_ONEXIT: return OnPreShutdown(wParam, lParam); + case EV_PROTO_ONOPTIONS: return OnOptionsInit(wParam, lParam); + } + + return 1; +} |