From c0ff932b9b6ba685160204fee0af84930f7aa922 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 11 Apr 2025 13:40:09 +0300 Subject: =?UTF-8?q?fixes=20#4975=20(CloudFile:=20=D0=BD=D1=83=D0=B6=D0=BD?= =?UTF-8?q?=D0=BE=20=D1=83=D0=B1=D0=B8=D1=80=D0=B0=D1=82=D1=8C=20=D1=83?= =?UTF-8?q?=D1=87=D1=91=D1=82=D0=BA=D1=83=20=D0=B8=D0=B7=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=B4=D0=BC=D0=B5=D0=BD=D1=8E=20=D0=B2=20=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D1=8E=20=D0=BA=D0=BE=D0=BD=D1=82=D0=B0=D0=BA=D1=82=D0=B0=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=20=D0=B5=D1=91=20=D0=BE=D1=82=D0=BA=D0=BB?= =?UTF-8?q?=D1=8E=D1=87=D0=B5=D0=BD=D0=B8=D0=B8)=20+=20some=20code=20clean?= =?UTF-8?q?ing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/CloudFile/src/cloud_file.cpp | 38 +++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 14 deletions(-) (limited to 'protocols/CloudFile/src/cloud_file.cpp') 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; +} -- cgit v1.2.3