diff options
author | George Hazan <george.hazan@gmail.com> | 2025-04-11 13:40:09 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2025-04-11 13:40:09 +0300 |
commit | c0ff932b9b6ba685160204fee0af84930f7aa922 (patch) | |
tree | 6b922da9dd5705c168d40f2eb691e453ddbf0713 /protocols/CloudFile/src/cloud_file.cpp | |
parent | 99584f314758d7ee3ef5faead704546ad0fdc10a (diff) |
fixes #4975 (CloudFile: нужно убирать учётку из подменю в меню контакта при её отключении) + some code cleaning
Diffstat (limited to 'protocols/CloudFile/src/cloud_file.cpp')
-rw-r--r-- | protocols/CloudFile/src/cloud_file.cpp | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/protocols/CloudFile/src/cloud_file.cpp b/protocols/CloudFile/src/cloud_file.cpp index f7079e980a..e227105d1c 100644 --- a/protocols/CloudFile/src/cloud_file.cpp +++ b/protocols/CloudFile/src/cloud_file.cpp @@ -8,13 +8,20 @@ CCloudService::CCloudService(const char *protoName, const wchar_t *userName, HPL nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE; nlu.szSettingsModule = (char*)protoName; nlu.szDescriptiveName.w = (wchar_t*)userName; - m_hConnection = Netlib_RegisterUser(&nlu); + m_hNetlibUser = Netlib_RegisterUser(&nlu); + + CreateProtoService(PS_UPLOAD, &CCloudService::UploadMenuCommand); + + g_arServices.insert(this); } CCloudService::~CCloudService() { - Netlib_CloseHandle(m_hConnection); - m_hConnection = nullptr; + if (!Miranda_IsTerminated()) + InitializeMenus(); + + Netlib_CloseHandle(m_hNetlibUser); + m_hNetlibUser = nullptr; } HPLUGIN CCloudService::GetId() const @@ -22,16 +29,6 @@ HPLUGIN CCloudService::GetId() const return m_pPlugin; } -const char* CCloudService::GetAccountName() const -{ - return m_szModuleName; -} - -const wchar_t* CCloudService::GetUserName() const -{ - return m_tszUserName; -} - INT_PTR CCloudService::GetCaps(int type, MCONTACT) { if (type == PFLAGNUM_1) @@ -181,4 +178,17 @@ UINT CCloudService::Upload(CCloudService *service, FileTransferParam *ftp) ftp->SetStatus(ACKRESULT_SUCCESS); return ACKRESULT_SUCCESS; -}
\ No newline at end of file +} + +int CCloudService::UnInit(PROTO_INTERFACE *proto) +{ + g_arServices.remove((CCloudService *)proto); + delete proto; + return 0; +} + +INT_PTR CCloudService::UploadMenuCommand(WPARAM hContact, LPARAM) +{ + OpenUploadDialog(hContact); + return 0; +} |