summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_misc.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-10-22 19:50:54 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-10-22 19:50:54 +0300
commit9548530c9e9c7bc1cbcf1c2c97008b217865fb4d (patch)
tree8ca6e9d9bcc4e764623c6aac793844ccbeba435e /protocols/JabberG/src/jabber_misc.cpp
parent12d0e94244510f84d210dfeb07959978f799bdd0 (diff)
fixes #2103 (Jabber: we should ignore AvatarHash if file does not exist)
Diffstat (limited to 'protocols/JabberG/src/jabber_misc.cpp')
-rwxr-xr-xprotocols/JabberG/src/jabber_misc.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp
index e4693220ae..74f6900762 100755
--- a/protocols/JabberG/src/jabber_misc.cpp
+++ b/protocols/JabberG/src/jabber_misc.cpp
@@ -148,13 +148,11 @@ void CJabberProto::GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_t
if (hContact != 0) {
char str[256];
JabberShaStrBuf buf;
- DBVARIANT dbv;
- if (!db_get_utf(hContact, m_szModuleName, "jid", &dbv)) {
- strncpy_s(str, dbv.pszVal, _TRUNCATE);
- str[sizeof(str) - 1] = 0;
- db_free(&dbv);
- }
- else _i64toa((LONG_PTR)hContact, str, 10);
+ ptrA szJid(getUStringA(hContact, "jid"));
+ if (szJid)
+ strncpy_s(str, szJid, _TRUNCATE);
+ else
+ _i64toa((LONG_PTR)hContact, str, 10);
mir_snwprintf(pszDest + tPathLen, MAX_PATH - tPathLen, L"%S%s", JabberSha1(str, buf), szFileType);
}
else if (m_ThreadInfo != nullptr) {