summaryrefslogtreecommitdiff
path: root/plugins/SmileyAdd/src
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2012-09-30 11:14:14 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2012-09-30 11:14:14 +0000
commit40d145149e5d95415fde7c3927706f9dd447902c (patch)
treedc8eab87a773aeeaaa946c0b23f9e90f2b324423 /plugins/SmileyAdd/src
parente27a27ba4d1a453241ed20c5fbc2d5cb5402105b (diff)
Fixed smiley cache folder (fixes #76)
git-svn-id: http://svn.miranda-ng.org/main/trunk@1725 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SmileyAdd/src')
-rw-r--r--plugins/SmileyAdd/src/download.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/plugins/SmileyAdd/src/download.cpp b/plugins/SmileyAdd/src/download.cpp
index 6da10b9525..ca228d8ee2 100644
--- a/plugins/SmileyAdd/src/download.cpp
+++ b/plugins/SmileyAdd/src/download.cpp
@@ -49,13 +49,10 @@ bool InternetDownloadFile(const char *szUrl, char* szDest, HANDLE &hHttpDwnl)
// initialize the netlib request
nlhr.cbSize = sizeof(nlhr);
nlhr.requestType = REQUEST_GET;
- nlhr.flags = NLHRF_NODUMP;
+ nlhr.flags = NLHRF_NODUMP | NLHRF_HTTP11 | NLHRF_PERSISTENT | NLHRF_REDIRECT;
nlhr.szUrl = (char*)szUrl;
nlhr.nlc = hHttpDwnl;
- if (CallService(MS_SYSTEM_GETVERSION, 0, 0) >= PLUGIN_MAKE_VERSION(0,9,0,5))
- nlhr.flags |= NLHRF_HTTP11 | NLHRF_PERSISTENT | NLHRF_REDIRECT;
-
// change the header so the plugin is pretended to be IE 6 + WinXP
nlhr.headersCount = 2;
nlhr.headers=(NETLIBHTTPHEADER*)alloca(sizeof(NETLIBHTTPHEADER)*nlhr.headersCount);
@@ -230,29 +227,27 @@ int FolderChanged(WPARAM, LPARAM)
void GetSmileyCacheFolder(void)
{
- TCHAR defaultPath[MAX_PATH];
if (ServiceExists(MS_FOLDERS_REGISTER_PATH))
{
hFolder = FoldersRegisterCustomPathT("SmileyAdd", "Smiley Cache", MIRANDA_USERDATAT _T("\\SmileyCache"));
- FoldersGetCustomPathT(hFolder, defaultPath, MAX_PATH, _T(""));
+ FoldersGetCustomPathT(hFolder, cachepath, MAX_PATH, _T(""));
+ hFolderHook = HookEvent(ME_FOLDERS_PATH_CHANGED, FolderChanged);
}
else
{
TCHAR* tszFolder = Utils_ReplaceVarsT(_T("%miranda_userdata%\\SmileyCache"));
- lstrcpyn(defaultPath, tszFolder, SIZEOF(defaultPath));
+ lstrcpyn(cachepath, tszFolder, MAX_PATH);
mir_free(tszFolder);
}
-
- hFolderHook = HookEvent(ME_FOLDERS_PATH_CHANGED, FolderChanged);
}
void DownloadInit(void)
{
NETLIBUSER nlu = {0};
nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_OUTGOING|NUF_HTTPCONNS|NUF_NOHTTPSOPTION;
+ nlu.flags = NUF_OUTGOING|NUF_HTTPCONNS|NUF_NOHTTPSOPTION|NUF_TCHAR;
nlu.szSettingsModule = "SmileyAdd";
- nlu.szDescriptiveName = Translate("SmileyAdd HTTP connections");
+ nlu.ptszDescriptiveName = TranslateT("SmileyAdd HTTP connections");
hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
GetSmileyCacheFolder();