diff options
-rw-r--r-- | plugins/Dropbox/src/dropbox_commands.cpp | 6 | ||||
-rw-r--r-- | plugins/Dropbox/src/dropbox_services.cpp | 11 | ||||
-rw-r--r-- | plugins/Dropbox/src/dropbox_utils.cpp | 5 |
3 files changed, 16 insertions, 6 deletions
diff --git a/plugins/Dropbox/src/dropbox_commands.cpp b/plugins/Dropbox/src/dropbox_commands.cpp index 7fef60be45..c4c1062573 100644 --- a/plugins/Dropbox/src/dropbox_commands.cpp +++ b/plugins/Dropbox/src/dropbox_commands.cpp @@ -24,7 +24,7 @@ void CDropbox::CommandList(void *arg) char path[MAX_PATH];
PreparePath((char*)param->data, path);
- if (path == NULL) {
+ if (path[0] == NULL) {
CMStringA error(FORMAT, T2Utf(TranslateT("\"%s\" command has invalid parameter.\nUse \"/help\" for more info.")), "/share");
ProtoBroadcastAck(MODULE, param->hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, param->hProcess, 0);
CallContactService(param->instance->GetDefaultContact(), PSR_MESSAGE, 0, (LPARAM)error.GetBuffer());
@@ -70,7 +70,7 @@ void CDropbox::CommandShare(void *arg) char path[MAX_PATH];
PreparePath((char*)param->data, path);
- if (path == NULL) {
+ if (path[0] == NULL) {
CMStringA error(FORMAT, T2Utf(TranslateT("\"%s\" command has invalid parameter.\nUse \"/help\" for more info.")), "/share");
ProtoBroadcastAck(MODULE, param->hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, param->hProcess, 0);
CallContactService(param->instance->GetDefaultContact(), PSR_MESSAGE, 0, (LPARAM)error.GetBuffer());
@@ -155,7 +155,7 @@ void CDropbox::CommandDelete(void *arg) char path[MAX_PATH];
PreparePath((char*)param->data, path);
- if (path == NULL) {
+ if (path[0] == NULL) {
CMStringA error(FORMAT, T2Utf(TranslateT("\"%s\" command has invalid parameter.\nUse \"/help\" for more info.")), "/delete");
ProtoBroadcastAck(MODULE, param->hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, param->hProcess, 0);
CallContactService(param->instance->GetDefaultContact(), PSR_MESSAGE, 0, (LPARAM)error.GetBuffer());
diff --git a/plugins/Dropbox/src/dropbox_services.cpp b/plugins/Dropbox/src/dropbox_services.cpp index 4666932190..08774cef96 100644 --- a/plugins/Dropbox/src/dropbox_services.cpp +++ b/plugins/Dropbox/src/dropbox_services.cpp @@ -172,6 +172,10 @@ INT_PTR CDropbox::UploadToDropbox(WPARAM wParam, LPARAM lParam) if (PathIsDirectory(uploadInfo->localPath))
{
// temporary unsupported
+
+ transfers.remove(ftp);
+ delete ftp;
+
return ACKRESULT_FAILED;
}
else
@@ -183,6 +187,9 @@ INT_PTR CDropbox::UploadToDropbox(WPARAM wParam, LPARAM lParam) *data = mir_utf8encodeT(ftp->GetData());
}
+ transfers.remove(ftp);
+ delete ftp;
+
return res;
}
@@ -197,6 +204,10 @@ INT_PTR CDropbox::UploadToDropboxAsync(WPARAM, LPARAM lParam) if (PathIsDirectory(uploadInfo->localPath))
{
// temporary unsupported
+
+ transfers.remove(ftp);
+ delete ftp;
+
return NULL;
}
else
diff --git a/plugins/Dropbox/src/dropbox_utils.cpp b/plugins/Dropbox/src/dropbox_utils.cpp index 56a9840a69..7976f08985 100644 --- a/plugins/Dropbox/src/dropbox_utils.cpp +++ b/plugins/Dropbox/src/dropbox_utils.cpp @@ -117,10 +117,9 @@ void CDropbox::SendToContact(MCONTACT hContact, const TCHAR *data) return;
}
- if (CallContactService(hContact, PSS_MESSAGE, 0, T2Utf(data)) != ACKRESULT_FAILED) {
- char *message = mir_utf8encodeT(data);
+ char *message = mir_utf8encodeT(data);
+ if (CallContactService(hContact, PSS_MESSAGE, 0, (LPARAM)message) != ACKRESULT_FAILED)
AddEventToDb(hContact, EVENTTYPE_MESSAGE, DBEF_UTF | DBEF_SENT, (DWORD)mir_strlen(message), (PBYTE)message);
- }
}
void CDropbox::PasteToInputArea(MCONTACT hContact, const TCHAR *data)
|