From 090353f5daa6bbe3e80225392bcd3de6ca39f3a1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 2 Mar 2013 16:58:06 +0000 Subject: fix for registering relative avatar path in Twitter git-svn-id: http://svn.miranda-ng.org/main/trunk@3845 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Twitter/src/proto.cpp | 16 +++++++--------- protocols/Twitter/src/proto.h | 1 - protocols/Twitter/src/version.h | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp index 7f587d73c5..3f42a70d17 100644 --- a/protocols/Twitter/src/proto.cpp +++ b/protocols/Twitter/src/proto.cpp @@ -48,18 +48,17 @@ TwitterProto::TwitterProto(const char *proto_name,const TCHAR *username) HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &TwitterProto::OnBuildStatusMenu, this); HookProtoEvent(ME_OPT_INITIALISE, &TwitterProto::OnOptionsInit, this); - def_avatar_folder_ = std::tstring( VARST( _T("%miranda_avatarcache%"))) + _T("\\") + m_tszUserName; - hAvatarFolder_ = FoldersRegisterCustomPathT("Avatars", m_szModuleName, def_avatar_folder_.c_str(), m_tszUserName); + tstring defFolder = std::tstring( _T("%miranda_avatarcache%\\")) + m_tszUserName; + hAvatarFolder_ = FoldersRegisterCustomPathT("Avatars", m_szModuleName, defFolder.c_str(), m_tszUserName); // Initialize hotkeys char text[512]; + mir_snprintf(text,SIZEOF(text),"%s/Tweet",m_szModuleName); + HOTKEYDESC hkd = {sizeof(hkd)}; - hkd.cbSize = sizeof(hkd); hkd.pszName = text; hkd.pszService = text; hkd.pszSection = m_szModuleName; // Section title; TODO: use username? - - mir_snprintf(text,SIZEOF(text),"%s/Tweet",m_szModuleName); hkd.pszDescription = "Send Tweet"; Hotkey_Register(&hkd); @@ -550,10 +549,9 @@ void TwitterProto::UpdateSettings() std::tstring TwitterProto::GetAvatarFolder() { TCHAR path[MAX_PATH]; - if(hAvatarFolder_ && FoldersGetCustomPathT(hAvatarFolder_,path,SIZEOF(path), _T("")) == 0) - return path; - - return def_avatar_folder_; + if (!hAvatarFolder_ || FoldersGetCustomPathT(hAvatarFolder_, path, SIZEOF(path), _T(""))) + mir_sntprintf(path, SIZEOF(path), _T("%s\\%s"), (TCHAR*)VARST( _T("%miranda_avatarcache%")), m_tszUserName); + return path; } int TwitterProto::GetAvatar(WPARAM,LPARAM) diff --git a/protocols/Twitter/src/proto.h b/protocols/Twitter/src/proto.h index 8a9525b91d..9287ff3636 100644 --- a/protocols/Twitter/src/proto.h +++ b/protocols/Twitter/src/proto.h @@ -161,7 +161,6 @@ private: twitter_id since_id_; twitter_id dm_since_id_; - std::tstring def_avatar_folder_; HANDLE hAvatarFolder_; bool in_chat_; diff --git a/protocols/Twitter/src/version.h b/protocols/Twitter/src/version.h index 7e6d456d0b..a6e94b3381 100644 --- a/protocols/Twitter/src/version.h +++ b/protocols/Twitter/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 1 #define __MINOR_VERSION 1 #define __RELEASE_NUM 0 -#define __BUILD_NUM 0 +#define __BUILD_NUM 1 #define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM #define __FILEVERSION_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM -- cgit v1.2.3