summaryrefslogtreecommitdiff
path: root/protocols/Facebook/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-01-17 14:37:50 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-01-17 14:37:50 +0300
commit4c60037f6852f7771ed86e0b285a872e4bbadb87 (patch)
treea6977ea0a68db5612f3ac8664efd9d66a483e52c /protocols/Facebook/src
parent893fe6d2f16f5e70087aa9d5949aff5aaff556d2 (diff)
PROTO_INTERFACE::GetAvatarPath - new helper for calculating avatars' root for an account
Diffstat (limited to 'protocols/Facebook/src')
-rw-r--r--protocols/Facebook/src/avatars.cpp7
-rw-r--r--protocols/Facebook/src/proto.cpp3
2 files changed, 5 insertions, 5 deletions
diff --git a/protocols/Facebook/src/avatars.cpp b/protocols/Facebook/src/avatars.cpp
index f8fd4fb73e..43b12dcdac 100644
--- a/protocols/Facebook/src/avatars.cpp
+++ b/protocols/Facebook/src/avatars.cpp
@@ -24,12 +24,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
void FacebookProto::GetAvatarFilename(MCONTACT hContact, wchar_t *pwszFileName)
{
- wchar_t wszPath[MAX_PATH];
- mir_snwprintf(wszPath, MAX_PATH, L"%s\\%S", VARSW(L"%miranda_avatarcache%"), m_szModuleName);
- CreateDirectoryTreeW(wszPath);
-
+ CMStringW wszPath(GetAvatarPath());
CMStringW id(getMStringW(hContact, DBKEY_ID));
- mir_snwprintf(pwszFileName, MAX_PATH, L"%s\\%s.jpg", wszPath, id.c_str());
+ mir_snwprintf(pwszFileName, MAX_PATH, L"%s\\%s.jpg", wszPath.c_str(), id.c_str());
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/Facebook/src/proto.cpp b/protocols/Facebook/src/proto.cpp
index db2d401e21..b773e6b7b0 100644
--- a/protocols/Facebook/src/proto.cpp
+++ b/protocols/Facebook/src/proto.cpp
@@ -87,6 +87,9 @@ FacebookProto::FacebookProto(const char *proto_name, const wchar_t *username) :
m_sid = _atoi64(getMStringA(DBKEY_SID));
m_szSyncToken = getMStringA(DBKEY_SYNC_TOKEN);
+ // Avatars
+ CreateDirectoryTreeW(GetAvatarPath());
+
// Create standard network connection
NETLIBUSER nlu = {};
nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;