diff options
-rw-r--r-- | include/m_file.h | 1 | ||||
-rw-r--r-- | plugins/NewStory/src/history_array.cpp | 12 | ||||
-rw-r--r-- | plugins/NewStory/src/stdafx.h | 1 | ||||
-rw-r--r-- | plugins/NewStory/src/templates.cpp | 6 | ||||
-rw-r--r-- | plugins/NewStory/src/version.h | 2 | ||||
-rw-r--r-- | src/core/stdfile/src/file.cpp | 13 |
6 files changed, 27 insertions, 8 deletions
diff --git a/include/m_file.h b/include/m_file.h index 41b4409589..7f8ccbb170 100644 --- a/include/m_file.h +++ b/include/m_file.h @@ -61,6 +61,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // name without any appended user names.
// Note that the directory name returned by this function does not necessarily exist.
#define MS_FILE_GETRECEIVEDFILESFOLDER "SRFile/GetReceivedFilesFolder"
+#define MS_FILE_GETRECEIVEDFILESFOLDERW "SRFile/GetReceivedFilesFolderW"
// notifies a caller about file send start
// wParam = (MCONTACT)hContact
diff --git a/plugins/NewStory/src/history_array.cpp b/plugins/NewStory/src/history_array.cpp index f622814d83..a47a54f5ba 100644 --- a/plugins/NewStory/src/history_array.cpp +++ b/plugins/NewStory/src/history_array.cpp @@ -94,6 +94,18 @@ void ItemData::load(bool bFullLoad) wtext = mir_utf8decodeW((char *)dbe.pBlob); break; + case EVENTTYPE_FILE: + wchar_t buf[MAX_PATH]; + CallService(MS_FILE_GETRECEIVEDFILESFOLDERW, hContact, (LPARAM)buf); + { + CMStringW wszFileName(buf); + wszFileName.Append(ptrW(DbEvent_GetTextW(&dbe, CP_ACP))); + wszFileName.Replace('\\', '/'); + wszFileName.Insert(0, L"file://"); + wtext = wszFileName.Detach(); + } + break; + default: wtext = DbEvent_GetTextW(&dbe, CP_ACP); break; diff --git a/plugins/NewStory/src/stdafx.h b/plugins/NewStory/src/stdafx.h index cf4437e53a..265607be0b 100644 --- a/plugins/NewStory/src/stdafx.h +++ b/plugins/NewStory/src/stdafx.h @@ -34,6 +34,7 @@ Boston, MA 02111-1307, USA. #include "m_chat_int.h" #include "m_clc.h" #include "m_clistint.h" +#include "m_file.h" #include "m_options.h" #include "m_skin.h" #include "m_langpack.h" diff --git a/plugins/NewStory/src/templates.cpp b/plugins/NewStory/src/templates.cpp index 727adc24c5..039d5306cd 100644 --- a/plugins/NewStory/src/templates.cpp +++ b/plugins/NewStory/src/templates.cpp @@ -249,11 +249,7 @@ void vfMessage(int, TemplateVars *vars, MCONTACT, ItemData *item) void vfFile(int, TemplateVars *vars, MCONTACT, ItemData *item) { - CMStringW wszFileName(item->getWBuf()); - wszFileName.Replace('\\', '/'); - wszFileName = L"[url]file://" + wszFileName + L"[/url]"; - - vars->SetVar('M', wszFileName, false); + vars->SetVar('M', item->getWBuf(), false); } void vfUrl(int, TemplateVars *vars, MCONTACT, ItemData *item) diff --git a/plugins/NewStory/src/version.h b/plugins/NewStory/src/version.h index 9be84bdbe7..9c11127072 100644 --- a/plugins/NewStory/src/version.h +++ b/plugins/NewStory/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0
#define __MINOR_VERSION 1
#define __RELEASE_NUM 0
-#define __BUILD_NUM 2
+#define __BUILD_NUM 3
#include <stdver.h>
diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp index 4bda297d0c..abe3152cdd 100644 --- a/src/core/stdfile/src/file.cpp +++ b/src/core/stdfile/src/file.cpp @@ -73,12 +73,20 @@ static INT_PTR GetReceivedFilesFolder(WPARAM wParam, LPARAM lParam) {
wchar_t buf[MAX_PATH];
GetContactReceivedFilesDir(wParam, buf, MAX_PATH, TRUE);
- char* dir = mir_u2a(buf);
- mir_strncpy((char*)lParam, dir, MAX_PATH);
+ char *dir = mir_u2a(buf);
+ mir_strncpy((char *)lParam, dir, MAX_PATH);
mir_free(dir);
return 0;
}
+static INT_PTR GetReceivedFilesFolderW(WPARAM wParam, LPARAM lParam)
+{
+ wchar_t buf[MAX_PATH];
+ GetContactReceivedFilesDir(wParam, buf, MAX_PATH, TRUE);
+ mir_wstrncpy((wchar_t *)lParam, buf, MAX_PATH);
+ return 0;
+}
+
static INT_PTR RecvFileCommand(WPARAM, LPARAM lParam)
{
LaunchRecvDialog((CLISTEVENT *)lParam);
@@ -427,6 +435,7 @@ int LoadSendRecvFileModule(void) CreateServiceFunction(MS_FILE_SENDSPECIFICFILES, SendSpecificFiles);
CreateServiceFunction(MS_FILE_SENDSPECIFICFILEST, SendSpecificFilesT);
CreateServiceFunction(MS_FILE_GETRECEIVEDFILESFOLDER, GetReceivedFilesFolder);
+ CreateServiceFunction(MS_FILE_GETRECEIVEDFILESFOLDERW, GetReceivedFilesFolderW);
CreateServiceFunction("SRFile/RecvFile", RecvFileCommand);
CreateServiceFunction("SRFile/OpenContRecDir", openContRecDir);
|