diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2016-02-27 16:03:20 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2016-02-27 16:03:20 +0000 |
commit | ce1317d110f70eee0d835ffa3c761168e2f5e9b7 (patch) | |
tree | ea290bde0b8761edd76cbdd00393d17586299bae /plugins/Dropbox/src/dropbox_services.cpp | |
parent | 2814cd2a0f6ed89dab0c4dca6b8dbb2c7523bef9 (diff) |
Drobpox:
- added search command
- fixed other commands
git-svn-id: http://svn.miranda-ng.org/main/trunk@16363 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dropbox/src/dropbox_services.cpp')
-rw-r--r-- | plugins/Dropbox/src/dropbox_services.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
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();
|