From ce1317d110f70eee0d835ffa3c761168e2f5e9b7 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sat, 27 Feb 2016 16:03:20 +0000 Subject: Drobpox: - added search command - fixed other commands git-svn-id: http://svn.miranda-ng.org/main/trunk@16363 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dropbox/src/dropbox_services.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'plugins/Dropbox/src/dropbox_services.cpp') diff --git a/plugins/Dropbox/src/dropbox_services.cpp b/plugins/Dropbox/src/dropbox_services.cpp index 7469521487..85c5e1c661 100644 --- a/plugins/Dropbox/src/dropbox_services.cpp +++ b/plugins/Dropbox/src/dropbox_services.cpp @@ -1,13 +1,5 @@ #include "stdafx.h" -HANDLE CDropbox::CreateProtoServiceFunctionObj(const char *szService, MIRANDASERVICEOBJ serviceProc, void *obj) -{ - char str[MAXMODULELABELLENGTH]; - mir_snprintf(str, "%s%s", MODULE, szService); - str[MAXMODULELABELLENGTH - 1] = 0; - return CreateServiceFunctionObj(str, serviceProc, obj); -} - INT_PTR CDropbox::ProtoGetCaps(WPARAM wParam, LPARAM) { switch (wParam) { @@ -117,7 +109,7 @@ INT_PTR CDropbox::ProtoSendMessage(WPARAM, LPARAM lParam) if (*szMessage == '/') { // parse commands char *sep = strchr(szMessage, ' '); - if (sep != NULL) *sep = 0; + //if (sep != NULL) *sep = 0; struct { @@ -127,13 +119,16 @@ INT_PTR CDropbox::ProtoSendMessage(WPARAM, LPARAM lParam) static commands[] = { { "help", &CDropbox::CommandHelp }, - { "list", &CDropbox::CommandContent }, + { "list", &CDropbox::CommandList }, { "share", &CDropbox::CommandShare }, + { "search", &CDropbox::CommandSearch }, { "delete", &CDropbox::CommandDelete } }; + char command[16] = {0}; + mir_strncpy(command, szMessage + 1, sep ? sep - szMessage : mir_strlen(szMessage)); for (int i = 0; i < _countof(commands); i++) { - if (!mir_strcmp(szMessage + 1, commands[i].szCommand)) { + if (!mir_strcmp(command, commands[i].szCommand)) { ULONG messageId = InterlockedIncrement(&hMessageProcess); CommandParam *param = new CommandParam(); -- cgit v1.2.3