diff options
author | George Hazan <george.hazan@gmail.com> | 2013-03-02 16:58:06 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-03-02 16:58:06 +0000 |
commit | 090353f5daa6bbe3e80225392bcd3de6ca39f3a1 (patch) | |
tree | 67bda2377778cb10ac5f00188549a4146bb58b13 /protocols/Twitter/src/proto.cpp | |
parent | 4cc24bc64c4de09208457b3e3a315cdc097e0ec1 (diff) |
fix for registering relative avatar path in Twitter
git-svn-id: http://svn.miranda-ng.org/main/trunk@3845 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Twitter/src/proto.cpp')
-rw-r--r-- | protocols/Twitter/src/proto.cpp | 16 |
1 files changed, 7 insertions, 9 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)
|