summaryrefslogtreecommitdiff
path: root/plugins/Dropbox/src/dropbox_services.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2015-04-17 09:52:42 +0000
committerKirill Volinsky <mataes2007@gmail.com>2015-04-17 09:52:42 +0000
commitb84ed6e7c85a8a59379aedae5501074fcfc9b161 (patch)
tree040fcfe3885d053d849b5dc2915d667682589f82 /plugins/Dropbox/src/dropbox_services.cpp
parentb9e3d0d154f994e77091e250a412415a2c454140 (diff)
dropbox: small improvments
git-svn-id: http://svn.miranda-ng.org/main/trunk@12880 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dropbox/src/dropbox_services.cpp')
-rw-r--r--plugins/Dropbox/src/dropbox_services.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/plugins/Dropbox/src/dropbox_services.cpp b/plugins/Dropbox/src/dropbox_services.cpp
index 6842e76989..270b129d50 100644
--- a/plugins/Dropbox/src/dropbox_services.cpp
+++ b/plugins/Dropbox/src/dropbox_services.cpp
@@ -1,5 +1,7 @@
#include "common.h"
+int g_nStatus = ID_STATUS_OFFLINE;
+
HANDLE CDropbox::CreateProtoServiceFunctionObj(const char *szService, MIRANDASERVICEOBJ serviceProc, void *obj)
{
char str[MAXMODULELABELLENGTH];
@@ -23,6 +25,45 @@ INT_PTR CDropbox::ProtoGetCaps(WPARAM wParam, LPARAM)
return 0;
}
+INT_PTR CDropbox::ProtoGetName(WPARAM wParam, LPARAM lParam)
+{
+ if (lParam) {
+ mir_strncpy((char *)lParam, MODULE, wParam);
+ return 0;
+ }
+
+ return 1;
+}
+
+INT_PTR CDropbox::ProtoLoadIcon(WPARAM wParam, LPARAM)
+{
+ return (LOWORD(wParam) == PLI_PROTOCOL) ? (INT_PTR)CopyIcon(LoadIconEx("main", FALSE)) : 0;
+}
+
+INT_PTR CDropbox::ProtoGetStatus(WPARAM, LPARAM)
+{
+ return g_nStatus;
+}
+
+INT_PTR CDropbox::ProtoSetStatus(void *obj, WPARAM wp, LPARAM)
+{
+ CDropbox *instance = (CDropbox*)obj;
+ int nStatus = wp;
+ if ((ID_STATUS_ONLINE == nStatus) || (ID_STATUS_OFFLINE == nStatus)) {
+ int nOldStatus = g_nStatus;
+ if (nStatus != g_nStatus) {
+ g_nStatus = nStatus;
+
+ MCONTACT hContact = instance->GetDefaultContact();
+ db_set_w(hContact, MODULE, "Status", nStatus);
+
+ ProtoBroadcastAck(MODULE, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)nOldStatus, g_nStatus);
+ }
+ }
+
+ return 0;
+}
+
INT_PTR CDropbox::ProtoSendFile(void *obj, WPARAM, LPARAM lParam)
{
CDropbox *instance = (CDropbox*)obj;