summaryrefslogtreecommitdiff
path: root/plugins/CloudFile/src/cloud_file.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/CloudFile/src/cloud_file.cpp')
-rw-r--r--plugins/CloudFile/src/cloud_file.cpp28
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))