diff options
author | aunsane <aunsane@gmail.com> | 2018-02-28 23:31:19 +0300 |
---|---|---|
committer | aunsane <aunsane@gmail.com> | 2018-02-28 23:34:28 +0300 |
commit | 98be8c0a0db8d4866535028e21a5d958c3d893ab (patch) | |
tree | f4de203d8fa1af0023621ede8316c7641499510c /plugins/CloudFile/src/cloud_file.cpp | |
parent | 107bbe53ce937334d8a47ca96e632f5a1f965725 (diff) |
CloudFile: cannot see cloud accounts after setup (fixed #1169)
Diffstat (limited to 'plugins/CloudFile/src/cloud_file.cpp')
-rw-r--r-- | plugins/CloudFile/src/cloud_file.cpp | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/plugins/CloudFile/src/cloud_file.cpp b/plugins/CloudFile/src/cloud_file.cpp index 7e3652122d..ed265f71aa 100644 --- a/plugins/CloudFile/src/cloud_file.cpp +++ b/plugins/CloudFile/src/cloud_file.cpp @@ -3,17 +3,25 @@ CCloudService::CCloudService(const char *protoName, const wchar_t *userName) : PROTO<CCloudService>(protoName, userName) { + MUUID muidLast = MIID_LAST; + m_hLangpack = GetPluginLangId(muidLast, 0); + NETLIBUSER nlu = {}; nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE; nlu.szSettingsModule = (char*)protoName; nlu.szDescriptiveName.w = (wchar_t*)userName; - hConnection = Netlib_RegisterUser(&nlu); + m_hConnection = Netlib_RegisterUser(&nlu); } CCloudService::~CCloudService() { - Netlib_CloseHandle(hConnection); - hConnection = nullptr; + Netlib_CloseHandle(m_hConnection); + m_hConnection = nullptr; +} + +int CCloudService::GetId() const +{ + return m_hLangpack; } const char* CCloudService::GetAccountName() const @@ -36,6 +44,20 @@ DWORD_PTR CCloudService::GetCaps(int type, MCONTACT) } } +int CCloudService::OnEvent(PROTOEVENTTYPE iEventType, WPARAM, LPARAM) +{ + switch (iEventType) { + case EV_PROTO_ONLOAD: + AddServiceMenuItem(this); + return 0; + + case EV_PROTO_ONERASE: + KillModuleMenus(m_hLangpack); + return 0; + } + return 1; +} + void CCloudService::Report(MCONTACT hContact, const wchar_t *data) { if (db_get_b(NULL, MODULE, "UrlAutoSend", 1)) |